Part Number Hot Search : 
AP9467GM CS536105 12C2052 LC8900 H8S2140B STA2065A AP9467GM UGSP15D
Product Description
Full Text Search
 

To Download ZLR64400H2032G Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  zilog worldwide headquarters ? 532 race street ? san jose, ca 95126-3432 telephone: 408.558.8500 ? fax: 408.558.8300 ? www.zilog.com ps024502-1205 preliminary product specification crimzon ? infrared microcontrollers zlr64400 rom mcu with learning amplification
ps024502-1205preliminary this publication is subject to replacement by a later edition. to determine whether a later edition exists, or to request copies of publications, contact: zilog worldwide headquarters 532 race street san jose, ca 95126-3432 telephone: 408.558.8500 fax: 408.558.8300 www.zilog.com zilog is a registered trademark of zilog inc. in the united states and in other countries. all other products and/or service names mentioned herein may be trademarks of the companies with which they are associated. document disclaimer ? 2005 by zilog, inc. all rights reserved. information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of information, devices, or technology described herein or otherwise. devices sold by zilog, inc. are covered by warranty and limitation of liability provisions appearing in the zilog, inc. terms and conditions of sale. zilog, inc. makes no warranty of merchantability or fitness for any purpose. except with the express written approval of zilog, use of information, devices, or technology as critical components of life support systems is not authorized. no licenses are conveyed, implicitly or otherwise, by this document under any intellectual property rights.
ps024502-1205preliminary zlr64400 rom mcu product specification iii table of contents architectural overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 i/o port pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 port 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 port 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 port 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 comparator inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 comparator outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 port configuration register (pcon) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 port 0 mode register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 port 0 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 port 2 mode register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 port 2 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 port 3 mode register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 port 3 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 memory and registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 rom program/constant memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 register file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 register pointer example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 linear memory addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 register pointer register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 user data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 stack pointer register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 register file summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 infrared learning amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 uart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 transmitting data using the polled method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 transmitting data using the interrupt-driven method . . . . . . . . . . . . . . . . . . . . . . 45
ps024502-1205preliminary zlr64400 rom mcu product specification iv receiving data using the polled method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 receiving data using the interrupt-driven method . . . . . . . . . . . . . . . . . . . . . . . . 46 uart interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 uart baud rate generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 uart receive data register/uart transmit data register . . . . . . . . . . . . . . . . . . . . 51 uart status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 uart control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 baud rate generator constant register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 counter/timer functional blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 input circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 t8 transmit mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 t8 demodulation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 t16 transmit mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 t16 demodulation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 ping-pong mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 timer output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 counter/timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 timer 8 capture high register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 timer 8 capture low register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 timer 16 capture high register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 timer 16 capture low register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 counter/timer 16 high hold register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 counter/timer 16 low hold register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 counter/timer 8 high hold register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 counter/timer 8 low hold register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 counter/timer 8 control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 t8 and t16 common functions register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 timer 16 control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 timer 8/timer 16 control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 interrupt priority register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 interrupt request register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 interrupt mask register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 crystal 1 oscillator pin (xtal1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 crystal 2 oscillator pin (xtal2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 internal clock signals (sclk and tclk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
ps024502-1205preliminary zlr64400 rom mcu product specification v resets and power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 power-on reset timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 reset/stop-mode recovery status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 voltage brown-out/standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 voltage detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 fast stop mode recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 stop mode recovery interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 stop mode recovery event sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 smr register events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 smr1 register events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 smr2 register events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 smr3 register events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 stop-mode recovery register 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 watch-dog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 z8 lxm cpu programming summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 addressing notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 flags register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 condition codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 z8 lxm cpu instruction summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 standard test conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 part number description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 precharacterization product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 document information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 document number description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 change log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 customer feedback form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
ps024502-1205preliminary zlr64400 rom mcu product specification vi list of figures figure 1. zlr64400 mcu functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 4 figure 2. zlr64400 mcu 20-pin pdip/soic/ssop pin configuration . . . . . . . . . . . . 5 figure 3. zlr64400 mcu 28-pin pdip/soic/ssop pin configuration . . . . . . . . . . . . 8 figure 4. port 0 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 figure 5. port 2 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 figure 6. port 3 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 7. port 3 counter/timer output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 8. program/constant memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 figure 9. register file 8-bit banked address map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 figure 10. register pointer ? detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 figure 11. register file ldx, ldxi linear 12-bit address map . . . . . . . . . . . . . . . . . 35 figure 12. learning amplification circuitry with the zlr64400 mcu . . . . . . . . . . . . 41 figure 13. uart block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 figure 14. uart asynchronous data format without parity . . . . . . . . . . . . . . . . . . . . 44 figure 15. uart asynchronous data format with parity . . . . . . . . . . . . . . . . . . . . . . . 44 figure 16. uart receiver interrupt service routine flow . . . . . . . . . . . . . . . . . . . . . . 49 figure 17. counter/timers block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 figure 18. counter/timer input circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 figure 19. transmit mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 figure 20. 8-bit counter/timer circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 figure 21. t8_out in single-pass mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 figure 22. t8_out in modulo-n mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 figure 23. demodulation mode count capture flowchart . . . . . . . . . . . . . . . . . . . . . . . 62 figure 24. demodulation mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 figure 25. demodulation mode flowchart with bit 4 of ctr3 set . . . . . . . . . . . . . . . . 64 figure 26. 16-bit counter/timer circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 figure 27. t16_out in single-pass mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 figure 28. t16_out in modulo-n mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 figure 29. ping-pong mode diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
ps024502-1205preliminary zlr64400 rom mcu product specification vii figure 30. output circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 figure 31. interrupt block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 figure 32. oscillator configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 figure 33. sclk/tclk circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 34. resets and watch-dog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 figure 35. smr register-controlled event sources . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 figure 36. smr1 register-controlled event sources . . . . . . . . . . . . . . . . . . . . . . . . . 101 figure 37. smr2 register-controlled event sources . . . . . . . . . . . . . . . . . . . . . . . . . 103 figure 38. smr3 register-controlled event sources . . . . . . . . . . . . . . . . . . . . . . . . . 106 figure 39. test load diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 figure 40. ac timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 figure 41. 28-pin ssop package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 figure 42. 28-pin soic package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 figure 43. 28-pin pdip package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 figure 44. 20-pin ssop package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 figure 45. 20-pin soic package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 figure 46. 20-pin pdip package diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 figure 47. part number example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 figure 48. document number example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
ps024502-1205preliminary zlr64400 rom mcu product specification viii list of tables table 1. zlr64400 rom mcu features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. power connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 table 3. zlr64400 mcu 20-pin pdip/soic/ssop sequential pin identification. . . . . 6 table 4. zlr64400 mcu 20-pin pdip/soic/ssop functional pin identification. . . . . 7 table 5. zlr64400 mcu 28-pin pdip/soic/ssop sequential pin identification. . . . . 9 table 6. zlr64400 mcu 28-pin pdip/soic/ssop functional pin identification. . . . 10 table 7. i/o port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 table 8. summary of port 3 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 table 9. port configuration register (pcon) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 table 10. port 0 mode register (p01m) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 table 11. port 0 register (p0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 12. port 2 mode register (p2m) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 table 13. port 2 register (p2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 table 14. port 3 mode register (p3m) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 table 15. port 3 register (p3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 table 16. register pointer register (rp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 table 17. user data register (user) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 table 18. stack pointer register (spl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 table 19. register file address summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 20. uart control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 21. bcnst register settings examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 table 22. uart receive/transmit data register (urdata/utdata) . . . . . . . . . . 51 table 23. uart status register (ust) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 table 24. uart control register (uctl). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 table 25. baud rate generator constant register (bcnst) . . . . . . . . . . . . . . . . . . . . . 54 table 26. timer control registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 27. timer 8 capture high register (hi8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 table 28. timer 8 capture low register (l08) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 table 29. timer 16 capture high register (hi16) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
ps024502-1205preliminary zlr64400 rom mcu product specification ix table 30. timer 16 capture low register (l016). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 table 31. counter/timer 16 high hold register (tc16h) . . . . . . . . . . . . . . . . . . . . . . 72 table 32. counter/timer 16 low hold register (tc16l) . . . . . . . . . . . . . . . . . . . . . . . 72 table 33. counter/timer 8 high hold register (tc8h). . . . . . . . . . . . . . . . . . . . . . . . . 73 table 34. counter/timer 8 low hold register (tc8l) . . . . . . . . . . . . . . . . . . . . . . . . . 73 table 35. counter/timer 8 control register (ctr0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 36. timer 8 and timer 16 common functions register (ctr1) . . . . . . . . . . . . . 76 table 37. counter/timer 16 control register (ctr2) . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 38. timer 8/timer 16 control register (ctr3) . . . . . . . . . . . . . . . . . . . . . . . . . . 80 table 39. interrupt control registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 table 40. interrupt types, sources, and vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 table 41. interrupt request register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 42. interrupt priority register (ipr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 table 43. interrupt request register (irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 table 44. interrupt mask register (imr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 table 45. reset and power management registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 table 46. low-voltage detection register (lvd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 table 47. stop-mode recovery register (smr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 table 48. stop-mode recovery register 1 (smr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 table 49. stop-mode recovery register 2 (smr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 table 50. stop-mode recovery register 3 (smr3) . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 table 51. stop-mode recovery register 4 (smr4) . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 table 52. watch-dog timer mode register (wdtmr) . . . . . . . . . . . . . . . . . . . . . . . 109 table 53. symbolic notation for operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 table 54. additional symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 table 55. flags register (flags) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 table 56. condition codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 table 57. z8 lxm cpu instruction summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 table 58. absolute maximum ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 table 59. capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
ps024502-1205preliminary zlr64400 rom mcu product specification x table 60. dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 table 61. ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 table 62. zlr64400 rom mcu part numbers description . . . . . . . . . . . . . . . . . . . 135
ps024502-1205preliminary architectural overview zlr64400 rom mcu product specification 1 architectural overview the zlr64400 rom mcu is a member of the crimzon ? family of infrared microcon- trollers. it provides a directly-compatible code upgrade path to other crimzon ? mcus, offers a robust learning function, and features up to 64kb read only memory (rom) and 1004 bytes of general-purpose random-access memory (ram). two timers allow the gen- eration of complex signals while performing other counting operations. a uart allows the zlr64400 mcu to be a slave/master database chip. when the uart is not in use, the baud rate generator can be used as a third timer. enhanced stop-mode recovery (smr) features allow the zlr64400 mcu to awaken from stop mode on any change of logic, and on any combination of the 12 smr inputs. the smr source can also be used as an interrupt source. many high-end remote control units offer a learning function. simply stated, a learning function allows a replacement remote unit to learn most infrared signals from the original remote unit and regenerate the signal. however, the amplifying circuits of many learning remotes are expensive, are not tuned well, and result in frustrated users. zilog ? s zlr64400 mcu is the first chip dedicated to solving this problem because it offers a built-in tuned amplification circuit in a wide range of positions and battery voltages. the only external component required is a photodiode. the zlr64400 mcu greatly reduces system cost, yet improves learning function reliabil- ity. best of all, however, will be the user experience promised by zilog ? s superior learn- ing function. with all new features, the zlr64400 mcu is excellent for infrared remote control and other mcu applications. features table 1 lists the memory, i/o, and power features of the zlr64400 rom memory micro- controller. additional features are listed below the table. table 1. zlr64400 rom mcu features devicerom (kb)ram* (bytes)i/o lines voltage range zlr64400 mcu64100424, or 162.0 ? 3.6 v note: *general-purpose registers implemented as random-access memory.
ps024502-1205preliminary features zlr64400 rom mcu product specification 2 the zlr64400 mcu supports 20 interrupt sources with 6 interrupt vectors, as follows: ? 2 from t8, t16 time-out and capture ? 3 from uart tx, uart rx, uart brg ? 1 from lvd ? 14 from smr source p20-p27, p30-p33, p00, p07 ? any change of logic from p20-p27, p30-p33 can generate an interrupt or smr additional features include: ? ir learning amplifier ? low power consumption ? 11 mw (typical) ? three standby modes: ? stop ? 1.7 a (typical) ? halt ? 0.6 ma (typical) ? low voltage reset ? intelligent counter/timer architecture to automate generation or reception and demod- ulation of complex waveform and pulsed signals: ? one programmable 8-bit counter/timer with two capture registers and two load registers ? one programmable 16-bit counter/timer with one 16-bit capture register pair and one 16-bit load register pair ? programmable input glitch filter for pulse reception ? the uart baud rate generator can be used as another 8-bit timer when the uart is not in use. ? six priority interrupts ? three external/uart interrupts ? two assigned to counter/timers ? one low-voltage detection interrupt ? 8-bit uart ? r x , t x interrupts ? 4800, 9600, 19200 and 38400 baud rates ? parity odd/even/none ? stop bits 1/2
ps024502-1205preliminary features zlr64400 rom mcu product specification 3 ? low voltage detection and high voltage detection flags ? programmable watch-dog timer/power-on reset circuits ? two on-board analog comparators with independent reference voltages and program- mable interrupt polarity ? user selectable options through option bit mask coding (on/off) ? port 0 pins 0 ? 3 pull-up transistors ? port 0 pins 4 ? 7 pull-up transistors ? port 2 pins 0 ? 7 pull-up transistors ? port 3 pins 0 ? 3 pull-up transistors ? watch-dog timer enabled at power-on reset all signals with an overline, ? ? , are active low. for example, b/w , in which word is active low, and b /w, in which byte is active low. power connections use the conventional descriptions listed in table 2 . table 2. power connections connectioncircuitdevice powerv cc v dd groundgndv ss note:
ps024502-1205preliminary functional block diagram zlr64400 rom mcu product specification 4 functional block diagram figure 1 illustrates the functional blocks of the zlr64400 microcontroller. figure 1. zlr64400 mcu functional block diagram
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 5 pin description figure 2 details the pin configuration of the zlr64400 device in the 20-pin pdip, soic, and ssop packages. figure 2. zlr64400 mcu 20-pin pdip/soic/ssop pin configuration p25 p26 p27 p07 v dd xtal2 xtal1 p31 p32 p33 p24 p23 p22 p21 p20 v ss p01 p00/p30 p36 p34 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 20-pin pdip soic ssop
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 6 table 3 identifies the functions and signal directions of each pin within the 20-pin pdip, soic, and ssop packages sequentially by pin. table 3. zlr64400 mcu 20-pin pdip/soic/ssop sequential pin identification pin #symbolfunctiondirection 1p25port 2, bit 5input/output 2p26port 2, bit 6input/output 3p27port 2, bit 7input/output 4p07port 0, bit 7input/output 5v dd power supply 6xtal2crystal oscillatoroutput 7xtal1crystal oscillatorinput 8p31port 3, bit 1input 9p32port 3, bit 2input 10p33port 3, bit 3input 11p34port 3, bit 4output 12p36port 3, bit 6output 13 1 p00port 0, bit 0input/output p30port 3, bit 0input 14p01port 0, bit 1input/output 15v ss ground 16p20port 2, bit 0input/output 17p21port 2, bit 1input/output 18p22port 2, bit 2input/output 19p23port 2, bit 3input/output 20p24port 2, bit 4input/output note: when the port 0 high-nibble pull-up option is enabled and the p30 input is low, current flows through the pull-up to ground.
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 7 table 4 identifies the functions and signal direction of each pin within the 20-pin pdip, soic, and ssop packages by function. table 4. zlr64400 mcu 20-pin pdip/soic/ssop functional pin identification pin #symbolfunctiondirection 13 1 p00port 0, bit 0input/output p30port 3, bit 0input 14p01port 0, bit 1input/output 4p07port 0, bit 7input/output 16p20port 2, bit 0input/output 17p21port 2, bit 1input/output 18p22port 2, bit 2input/output 19p23port 2, bit 3input/output 20p24port 2, bit 4input/output 1p25port 2, bit 5input/output 2p26port 2, bit 6input/output 3p27port 2, bit 7input/output 8p31port 3, bit 1input 9p32port 3, bit 2input 10p33port 3, bit 3input 11p34port 3, bit 4output 12p36port 3, bit 6output 5v dd power supply 15v ss ground 7xtal1crystal oscillatorinput 6xtal2crystal oscillatoroutput note: when the port 0 high-nibble pull-up option is enabled and the p30 input is low, current flows through the pull-up to ground.
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 8 figure 3 details the pin configuration of the zlr64400 device in the 28-pin pdip, soic, and ssop packages. figure 3. zlr64400 mcu 28-pin pdip/soic/ssop pin configuration p24 p23 p22 p21 p20 p03 v ss p02 p01 p00 p30 p36 p37 p35 p25 p26 p27 p04 p05 p06 p07 v dd xtal2 xtal1 p31 p32 p33 p34 1 28-pin pdip soic ssop 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 9 table 5 identifies the functions and signal directions of each pin within the 28-pin pdip, soic, and ssop packages sequentially by pin. table 5. zlr64400 mcu 28-pin pdip/soic/ssop sequential pin identification pinsymbolfunctiondirection 1p25port 2, bit 5input/output 2p26port 2, bit 6input/output 3p27port 2, bit 7input/output 4p04port 0, bit 4input/output 5p05port 0, bit 5input/output 6p06port 0, bit 6input/output 7p07port 0, bit 7input/output 8v dd power supply 9xtal2crystal oscillatoroutput 10xtal1crystal oscillatorinput 11p31port 3, bit 1input 12p32port 3, bit 2input 13p33port 3, bit 3input 14p34port 3, bit 4output 15p35port 3, bit 5output 16p37port 3, bit 7output 17p36port 3, bit 6output 18p30port 3, bit 0; connect to v cc if not used input 19p00port 0, bit 0input/output 20p01port 0, bit 1input/output 21p02port 0, bit 2input/output 22v ss ground 23p03port 0, bit 3input/output 24p20port 2, bit 0input/output 25p21port 2, bit 1input/output 26p22port 2, bit 2input/output 27p23port 2, bit 3input/output 28p24port 2, bit 4input/output
ps024502-1205preliminary pin description zlr64400 rom mcu product specification 10 table 6 identifies the functions and signal directions of each pin within the 28-pin pdip, soic, and ssop packages by function. table 6. zlr64400 mcu 28-pin pdip/soic/ssop functional pin identification pinsymbolfunctiondirection 19p00port 0, bit 0input/output 20p01port 0, bit 1input/output 21p02port 0, bit 2input/output 23p03port 0, bit 3input/output 4p04port 0, bit 4input/output 5p05port 0, bit 5input/output 6p06port 0, bit 6input/output 7p07port 0, bit 7input/output 24p20port 2, bit 0input/output 25p21port 2, bit 1input/output 26p22port 2, bit 2input/output 27p23port 2, bit 3input/output 28p24port 2, bit 4input/output 1p25port 2, bit 5input/output 2p26port 2, bit 6input/output 3p27port 2, bit 7input/output 18p30port 3, bit 0; connect to v cc if not used input 11p31port 3, bit 1input 12p32port 3, bit 2input 13p33port 3, bit 3input 14p34port 3, bit 4output 15p35port 3, bit 5output 17p36port 3, bit 6output 16p37port 3, bit 7output 8v dd power supply 22v ss ground 10xtal1crystal oscillatorinput 9xtal2crystal oscillatoroutput
ps024502-1205preliminary i/o port pin functions zlr64400 rom mcu product specification 11 i/o port pin functions the zlr64400 mcu features three 8-bit ports, which are described below. ? port 0 is nibble-programmable as either input or output ? port 2 is bit-programmable as either input or output ? port 3 features four inputs on the lower nibble and four outputs on the upper nibble port 0 and 2 internal pull-ups are disabled on any pin or group of pins when programmed into output mode. the cmos input buffer for each port 0 or 2 pin is always connected to the pin, even when the pin is configured as an output. if the pin is configured as an open-drain output and no external signal is applied, a high output state can cause the cmos input buffer to float. this might lead to excessive leakage current of more than 100 a. to prevent this leakage, connect the pin to an external signal with a defined logic level or ensure its output state is low, especially during stop mode. port 0, 1, and 2 have both input and output capability. the input logic is always present no matter whether the port is configured as input or output. when doing a read in- struction, the mcu reads the actual value at the input logic but not from the output buff- er. in addition, the instructions of or, and, and xor have the read-modify-write sequence. the mcu first reads the port, and then modifies the value and load back to the port. precaution must be taken if the port is configured as open-drain output or if the port is driving any circuit that makes the voltage different from the desired output logic. for example, pins p00 ? p07 are not connected to anything else. if it is configured as open- drain output with output logic as one, it is a floating port and reads back as zero. the following instruction sets p00 ? p07 all low. ? ee?y?e table 7 summarizes the registers used to control i/o ports. some port pin functions can also be affected by control registers for other peripheral functions. table 7. i/o port control registers address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage # 0000 ? 300port 0p0 xxh 22 0020 ? 302port 2p2 xxh 24 notes: caution:
ps024502-1205preliminary port 0 zlr64400 rom mcu product specification 12 port 0 port 0 is an 8-bit, bidirectional, cmos-compatible port. its eight i/o lines are configured under software control to create a nibble i/o port. the output drivers are push/pull or open-drain, controlled by bit 2 of the pcon register. if one or both nibbles are required for i/o operation, they must be configured by writing to the port 0 mode register (p01m). after a hardware reset or a stop-mode recovery (smr), port 0 is configured as an input port. port 0, bit 7 is used as the transmit output of the uart when uart tx is enabled.the i/o function of port 0, bit 7 is overridden by the uart serial output (txd) when uart tx is enabled (uctl[7] = 1). the pin must be configured as an output for txd data to reach the pin (p0m[6] = 0). an optional pull-up transistor is available as an user selectable mask option on all port 0 bits with nibble select. see the configuration illustration in figure 4 . 0030 ? 303port 3p3 0xh 26 0f6allf6port 2 mode registerp2m ffh 23 0f7allf7port 3 mode registerp3m x x x x _ x 0 0 0b 25 0f8allf8port 0 mode registerp01m x1xx_xxx1b 21 f00f00port configuration registerpcon x x x x _ x 1 x 0b 20 table 7. i/o port control registers (continued) address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage #
ps024502-1205preliminary port 2 zlr64400 rom mcu product specification 13 port 2 port 2 is an 8-bit, bidirectional, cmos-compatible i/o port. its eight i/o lines can be inde- pendently configured under software control as inputs or outputs. port 2 is always avail- able for i/o operation. a mask programmable option bit is available to connect eight pull- up transistors on this port. bits programmed as outputs are globally programmed as either push/pull or open-drain. the power-on reset function resets with the eight bits of port 2 [p27:20] configured as inputs. port 2 also has an 8-bit input or and and gate and edge detection circuitry, which can be used to wake up the part. p20 can be programmed to access the edge-detection circuitry in demodulation mode. see the configuration illustration in figure 5 . figure 4. port 0 configuration
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 14 port 3 port 3 is a 8-bit, cmos-compatible fixed i/o port (see figure 6 ). port 3 consists of four fixed inputs (p33:p30) and four fixed outputs (p37:p34). p30, p31, p32, and p33 are stan- dard cmos inputs with option enabled pull-up transistors and can be configured under software control as interrupts, as receive data input to the uart block, as input to com- parator circuits, or as input to the ir learning amp. p34, p35, p36, and p37 are push/pull outputs, and can be configured as outputs from the counter/timers. see the configuration illustration in figure 6 . figure 5. port 2 configuration
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 15 p31 can be used as an interrupt, analog comparator input, infrared learning amplifier input, normal digital input pin and as a stop-mode recovery source. when bit 2 of the port 3 mode register (p3m) is set, p31 is used as the infrared learning amplifier, ir1. the ref- erence source for ir1 is gnd. the infrared learning amplifier is disabled during stop mode. when bit 1 of p3m is set, the part is in analog mode and the analog comparator, comp1 is used. the reference voltage for comp1 is p30 (p ref1 ). when in analog mode, p30 cannot be read as a digital input when the cpu reads bit 0 of the port 3 regis- figure 6. port 3 configuration
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 16 ter; such reads always return a value of 1. also, when in analog mode, p31 cannot be used as a stop-mode recovery source because in stop mode, the comparator is disabled, and its output will not toggle. the programming of bit 2 of the p3m register takes prece- dence over the programming of bit 1 in determining the function of p31. if both bits are set, p31 functions as an ir learning amplifier instead of an analog comparator. as shown in figure 6 , the output of the function selected for p31 can be used as a source for irq2 interrupt assertion. the irq2 interrupt can be configured to be based upon detecting a ris- ing, falling, or edge-triggered input change using bits 6 and 7 of the irq register. the p31 output stage signal also goes to the counter/timer edge detection circuitry in the same way that p20 does. p32 can be used as an interrupt, analog comparator, uart receiver, normal digital input and as a stop-mode recovery source. when bit 6 of uctl is set, p32 functions as a receive input for the uart. when bit 1 of the p3m register is set, thereby placing the part into analog mode, p32 functions as an analog comparator, comp2. the reference voltage for comp2 is p33 (p ref 2). p32 can be used as a rising, falling or edge-triggered interrupt, irq0, using irq register bits 6 and 7. if uart receiver interrupts are not enabled, the uart receive interrupt is used as the source of interrupts for irq0 instead of p32. when in analog mode p32 cannot be used as a stop-mode recovery source because the com- parators are turned off in stop mode. when in analog mode, p33 cannot be read through bit 3 of the port 3 register as a dig- ital input by the cpu. in this case, a read of bit 3 of the port 3 register indicates whether a stop-mode recovery condition exists. reading a value of 0 indicates that a stop-mode recovery condition does exist; if the zlr64400 mcu is presently in stop mode, it will exit stop mode. reading a value of 1 indicates that no condition exists to remove the zlr64400 from stop mode. additionally, when in analog mode, p33 cannot be used as an interrupt source. instead, the existence of a stop-mode recovery condition can gener- ate an interrupt, if enabled. p33 can be used as a falling-edge interrupt, irq1, when not in analog mode. irq1 is also used as the uart t x interrupt and the uart brg inter- rupt. only one source is active at a time. if bits 7 and 5 of uctl are set to 1, irq1 will transmit an interrupt when the transmit shift register is empty. if bits 0 and 5 of uctl are set to 1 and bit 6 of uctl is cleared to 0, the brg interrupts will activate irq1. comparators and the ir amplifier are powered down by entering stop mode. for p30:p33 to be used as a stop-mode recovery source during stop mode, these inputs must be placed into digital mode. when in analog mode, do not configure any port 3 input as a stop-mode recovery source. the configuration of these inputs must be re-initialized after stop-mode recovery or power-on reset. note:
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 17 2 port 3 also provides output for each of the counter/timers and the and/or logic (see figure 7 ). control is performed by programming ctr1 bits 5 and 4, ctr0 bit 0, and ctr2 bit 0. table 8.summary of port 3 pin functions pini/ocounter/timerscomparatorinterruptirampuart p30inref1 p31ininan1irq2ir1 p32inan2irq0uart rx p33inref2irq1 p34outt8ao1irout p35outt16 p36outt8/t16 p37outao2
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 18 figure 7. port 3 counter/timer output configuration ey?? ?? e e?? e? ??? ???? e ??? ??? y??? ?? e y?e? ?? e e ??? ????? e ??? y??? ?? ? ? ? ? e e?? e? e?? e ey?? ?? e ? e?? e e? e e? e ? ? p e? ?? ee e ? e ? ? p ? p
ps024502-1205preliminary port 3 zlr64400 rom mcu product specification 19 comparator inputs in analog mode, p31 and p32 have a comparator front end. the comparator reference is supplied by p33 and p ref1 . in this mode, the p33 internal data latch and its corresponding irq1 are diverted to the stop-mode recovery sources (excluding p31, p32, and p33) as indicated in figure 6on page 15 . in digital mode, p33 is used as bit 3 of the port 3 input register, which then generates irq1. comparators are powered down by entering stop mode. for p30:p33 to be used as a stop-mode recovery source, these inputs must be placed into digital mode. comparator outputs the comparators can be programmed to be output on p34 and p37 by setting bit 0 of the pcon register. note:
ps024502-1205preliminary port configuration register (pcon) zlr64400 rom mcu product specification 20 port configuration register (pcon) the port configuration (pcon) register, shown in table 9 , configures the port 0 output mode and the comparator output on port 3. the pcon register is located in expanded reg- ister bank f, address 00h. this register is not reset after a stop-mode recovery. table 9. port configuration register (pcon) bit 7 6 5 4 3 2 1 0 field reservedport 0 output modereservedcomp./ir amp. output port 3 reset x x x x x 1 x 0 r/w ? w ? w address bank f: 00h; linear: f00h bit positionvaluedescription [7:3] ? reserved ? writes have no effect; reads 11111b. [2] 0 1 port 0 output mode ? controls the output mode of port 0. write only; reads return 1. open-drain push/pull [1] ? reserved ? writes have no effect; reads 1. [0] 0 1 comparator or ir amplifier output port 3 ? select digital outputs or comparator and ir amplifier outputs on p34 and p37. write only; reads return 1. p34 and p37 outputs are digital. p34 is comparator 1 or ir amplifier output, p37 is comparator 2 output. note:
ps024502-1205preliminary port 0 mode register zlr64400 rom mcu product specification 21 port 0 mode register the port 0 mode register determines the i/o direction of port 0. the port 0 direction is nibble-programmable. bit 6 controls the upper nibble of port 0, bits [7:3]. bit 0 controls the lower nibble of port 0, bits [3:0]. see table 11 . only p00, p01, and p07 are available on crimzon ? zlr64400 mcu 20-pin configura- tions. table 10. port 0 mode register (p01m) bit 7 6 5 4 3 2 1 0 field reservedp07:p04 modereservedp03:p00 mode reset x1xxxxx1 r/w ? w ????? w address bank independent: f8h; linear: 0f8h bit positionvaluedescription 70reserved ? writes have no effect. reads 1b. [6] 0 1 p07:p04 mode output. input. [5:1] ? reserved ? writes have no effect. reads 11111b. [0] 0 1 p00:p03 mode output. input. note:
ps024502-1205preliminary port 0 register zlr64400 rom mcu product specification 22 port 0 register the port 0 register allows read and write access to the port 0 pins. see table 11 . only p00, p01, and p07 are available on crimzon ? zlr64400 mcu 20-pin configura- tions. table 11. port 0 register (p0) bit 7 6 5 4 3 2 1 0 field p07p06p05p04p03p02p01p00 reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank 0 ? 3: 00h; linear: 000h bit positionr/wdescription [7] read: 0 1 write: 0 1 port 0 pin 7 ? available for i/o if uart tx is disabled. (pin configured as input or output in p01m register.) pin level is low. pin level is high. (pin configured as output in p01m register, uctl[7]=0.) assert pin low. assert pin high if configured as push-pull; make pin high-impedance if it is open drain. [6:0] read: 0 1 write: 0 1 port 0 pins 6 ? 0 ? each bit provides access to the corresponding port 0 pin. (pin configured as input or output in p01m register.) pin level is low. pin level is high. (pin configured as output in p01m register.) assert pin low. assert pin high if configured as push-pull; make pin high-impedance if it is open drain. note:
ps024502-1205preliminary port 2 mode register zlr64400 rom mcu product specification 23 port 2 mode register the port 2 mode register determines the i/o direction of each bit on port 2. bit 0 of the port 3 mode register determines whether the output drive is push/pull or open-drain. see table 12 . this register is not reset after a stop-mode recovery. table 12. port 2 mode register (p2m) bit 7 6 5 4 3 2 1 0 field p27 i/o definition p26 i/o definition p25 i/o definition p24 i/o definition p23 i/o definition p22 i/o definition p21 i/o definition p20 i/o definition reset 1 1 1 1 1 1 1 1 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: f6h; linear: 0f6h bit positionvaluedescription [7]0 1 defines p27 as output. defines p27 as input. [6]0 1 defines p26 as output. defines p26 as input. [5]0 1 defines p25 as output. defines p25 as input. [4]0 1 defines p24 as output. defines p24 as input. [3]0 1 defines p23 as output. defines p23 as input. [2]0 1 defines p22 as output. defines p22 as input. [1]0 1 defines p21 as output. defines p21 as input. [0]0 1 defines p20 as output. defines p20 as input. note:
ps024502-1205preliminary port 2 register zlr64400 rom mcu product specification 24 port 2 register the port 2 register allows read and write access to the port 2 pins. see table 13 . table 13. port 2 register (p2) bit 7 6 5 4 3 2 1 0 field p27p26p25p24p23p22p21p20 reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank 0 ? 3: 02h; linear: 002h bit positionvaluedescription [7:0] read: 0 1 write: 0 1 port 2 pins 7 ? 0 ? each bit provides access to the corresponding port 2 pin. (pin configured as input or output in p2m register.) pin level is low. pin level is high. (pin configured as output in p2m register.) assert pin low. assert pin high if configured as push-pull; make pin high-impedance if it is open drain.
ps024502-1205preliminary port 3 mode register zlr64400 rom mcu product specification 25 port 3 mode register the port 3 mode register is used primarily to configure the functionality of the port 3 inputs. when bit 2 is set, the ir learning amplifier is used instead of the comp1 com- parator, regardless of the value of bit 1. see table 14 . this register is not reset after a stop-mode recovery. table 14. port 3 mode register (p3m) bit 7 6 5 4 3 2 1 0 field reservedir learning amplifier digital/analog mode port 2 open- drain reset x x x x x 0 0 0 r/w ????? www address bank independent: f7h; linear 0f7h bit positionr/wvaluedescription [7:3] ?? reserved ? writes have no effect. reads return 11111b. [2] w0 1 ir learning amplifier disabled. ir learning amplifier enabled with p31 configured as amplifier input. [1] w 0 1 digital/analog mode p30, p31, p32, p33 are digital inputs. p30, p32, and p33 are comparator inputs. if p3m[2]=0, p31 is also a comparator input. if p3m[2]=1, p31 is the ir amplifier input. [0] w0 1 port 2 open-drain. port 2 push/pull. note:
ps024502-1205preliminary port 3 register zlr64400 rom mcu product specification 26 port 3 register the port 3 register allows read access to port pins p33 through p30 and write access to the port pins p37 through p34. see table 15 . table 15. port 3 register (p3) bit 7 6 5 4 3 2 1 0 field p37p36p35p34p33p32p31p30 reset 0 0 0 0 x x x x r/w r/wr/wr/wr/wr/wr/wr/wr/w address banks 0 ? 3: 03h; linear: 003h bit positionvaluedescription [7] write: 0 1 port 3, pin 7 output ? writes to this bit do not affect the pin state if write-only register bit pcon[0] has been written with a 1, which configures p37 as the comparator 1 or ir amplifier output. p37 asserted low if pcon[0]=0. p37 asserted high if pcon[0]=0. a read returns the last value written to this bit. [6] write: 0 1 port 3, pin 6 output ? writes to this bit do not affect the pin state if register bits ctr1[7:6]=01, which configures p36 as the timer 8 and timer 16 combined logic output. p36 asserted low. p36 asserted high. a read returns the last value written to this bit. [5] write: 0 1 port 3, pin 5 output ? writes to this bit do not affect the pin state if register bit ctr2[0]=1, which configures p35 as the timer 16 output. p35 asserted low. p35 asserted high. a read returns the last value written to this bit. [4] write: 0 1 port 3, pin 4 output ? writes to this bit do not affect the pin state if write only register bit pcon[0]=1, which configures p34 as comparator 2 output, or register bit ctr0[0]=1, which configures p34 as timer 8 output. p34 asserted low. p34 asserted high. a read returns the last value written to this bit.
ps024502-1205preliminary port 3 register zlr64400 rom mcu product specification 27 this register is not reset after a stop-mode recovery. [3]read: 0 1 0 1 port 3, pin 3 input ? writing this bit has no effect. if p3m[1]=0: p33 is low. p33 is high. if p3m[1]=1 or smr4[4]=1: smr condition exists. smr condition does not exist. [2]read: 0 1 0 1 port 3, pin 2 input ? writing this bit has no effect. if p3m[1]=0: p32 input is low. p32 input is high. if p3m[1]=1: comparator 2 output is low. comparator 2 output is high. [1] read: 0 1 0 1 0 1 port 3, pin 1 input ? writing this bit has no effect. if p3m[2:1]=00: p31 input is low. p31 input is high. if p3m[2:1]=01: comparator 1 output is low. comparator 1 output is high. if p3m[2:1]=10 or 11: ir amplifier output is low. ir amplifier output is high. [0]read: 0 1 1 port 3, pin 0 input ? writing this bit has no effect. if p3m[1]=00: p30 input is low. p30 input is high. if p3m[1]=1: reads as 1. bit positionvaluedescription note:
ps024502-1205preliminary memory and registers zlr64400 rom mcu product specification 28 memory and registers the z8 lxm cpu used in the zlr64400 family of devices incorporates special features to extend the available memory space while maintaining the benefits of a z8 ? cpu core in consumer and battery-operated applications. rom program/constant memory the zlr64400 family of devices can address up to 64kb of read only (rom) memory, used for object code (program instructions and immediate data) and constant data (rom tables and data constants). the first 12 bytes of the memory are reserved for the six available 16-bit interrupt request (irq) vectors. upon reset, program execution begins at address 000ch in the memory. execution rolls over to the beginning of the memory if the program counter exceeds the address (ffffh). the entire rom memory is available for either program code or constant data. constant data can be accessed only by the load constant (ldc and ldci) instructions. ldc and ldci use 16-bit addresses to access the memory. figure 8 on page 29 illustrates the program/constant memory map for the device.
ps024502-1205preliminary register file zlr64400 rom mcu product specification 29 register file this device features 1056 bytes of register file space, organized in 256-byte banks. bank 0 contains 237 bytes of ram addressed as general-purpose registers, 4 port addresses (of which one is reserved), and 16 control register addresses. banks 1, 2, and 3 each contain 256 general-purpose register bytes. banks d and f each contain 16 addresses for control registers. all other banks are reserved and must not be selected. the current bank is selected for 8-bit direct or indirect addressing by writing register pointer bits rp[3:0]. in the current bank, a 16-byte working register group (addressed as r0 ? r15) is selected by writing rp[7:4]. a working register operand requires only 4 bits of program memory. there are 16 working register groups per bank. see figure 9 on page 31 and figure 10 on page 32 . figure 8. program/constant memory map program irq 0 ? 5 or 000ch (reset) rom memory vectors 0000h = 16-bit address not to scale constants ffffh
ps024502-1205preliminary register file zlr64400 rom mcu product specification 30 8-bit addresses in the range f0h ? ffh (and the equivalent 4-bit addresses) are bank-inde- pendent, meaning they always access the control registers in bank 0, regardless of the rp[3:0] value. addresses in the range 00h ? 03h always access the bank 0 port registers unless bank d or f is selected. (port 01h is not implemented in this device.) when bank d or f is selected, addresses 10h ? efh access the bank 0 general-purpose registers. the ldx and ldxi instructions or indirect addressing can be used to access the bank 1 ? 3 registers not accessible by 8-bit or working register addresses (12-bit addresses 100h ? 103h, 1f0h ? 1ffh, 200h ? 203h, 2f0h ? 2ffh, 300h ? 303h, and 3f0h ? 3ffh). see linear memory addressing on page 33 . stack the stack pointer register (spl) is bank 0 register ffh. operations that use the stack pointer always addresses bank 0, regardless of the rp[3:0] setting. for details about the stack, see the z8 lxm cpu core user manual (um0183) . this device does not use a stack pointer high byte. bank 0 register feh can be used to store user data; see user data register on page 37 .
ps024502-1205preliminary register file zlr64400 rom mcu product specification 31 figure 9. register file 8-bit banked address map f0h ? ffh cpu control f0h ? ffh cpu control ports 00h ? 03h general registers cpu control f0h ? ffh 04h ? efh purpose cpu control f0h ? ffh cpu control f0h ? ffh bank 0 banks 1 ? 3 bank 0 peripheral 00h ? 0fh bank d control bank 0 peripheral 00h ? 0fh bank f control = bank-independent address (always accesses bank 0) general registers 04h ? efh purpose cpu control f0h ? ffh ports 00h ? 03h general purpose registers 10h ? efh general purpose registers 10h ? efh * compiler ? s default interrupt service routine working registers.not to scale
ps024502-1205preliminary register file zlr64400 rom mcu product specification 32 figure 10. register pointer ? detail ?? ??? 2??? o ??? ??1-??? o? ?????-- ?a??? ? ??? ??1-??? 2??? -??o?- ??? ???a? ???21 ??1-??? 1??? ???????????e ??1-??? e2??? ??e? e? ?? ??? 2??? o ??? ??1-??? o? ?????-- ?a??? ? ??? 2-?????2 2?- ? ??? -??o?? ??1-??? ??? ? ?e ??? ? ?? e e e e ? ? ?e ?e e ee ? ?e ? ee? -????- ??1-??? t?2 e? ??21 ??1-??? ?? e ? ?e ??o?? ??21 ??1-??? ?? ??1-??? ?? e ??1-??? ?? ? ??1-??? ?? ? ?? e??- ?t?2- ep ?2 ??1-??? ?? ? ? ?e? ???a? ?????a? t?2
ps024502-1205preliminary register file zlr64400 rom mcu product specification 33 register pointer example ??? ?e ? ee? ?e ? e?? e ?? ? e?? ? ?? ? e?? ? ? ? e?? but if: ??? ?e ? e? ?e ? y?e ?? ? y?? ?? ? y?? ? ? y? the counter/timers are mapped into erf group d. access is easily performed using the following code segment. ? ?e? ye?? ???? ?? o? ????-- ? t?2 ? ????21 ??1-??? 1?? e ? ?e?y? ?? y?e ? ?? y? ?? y?? ? ??? ?? y?? y?? ? ?e? y?? ???? ??2??? ??1-??? t?2 ?2? ???21 ? ??1-??? 1?? o t?2 e o? ????-- ? ??? ?? y?? ??1-??? ?? ? ??? ?? y?? ??1-??? ?? linear memory addressing in addition to using the rp register to designate a bank and working register group for 8- bit or 4-bit addressing, programs can use 12-bit linear addressing to load a register in any other bark to or from a register in the current bank. linear addressing is implemented in the ldx and ldxi instructions only. linear addressing treats the register file as if all of the registers are logically ordered end-to-end, as opposed to being grouped into banks and working register groups, as shown in figure 11 on page 35 . for linear addressing, register file addresses are numbered sequentially from bank 0, register 00h to bank 0, register ffh, then continuing with bank 1, register 00h, and so on up to bank f, register ffh. using the ldx and/or the ldxi instructions, either the target or destination register loca- tion can be addressed through a 12-bit linear address value stored in a general-purpose register pair. for example, the following code uses linear addressing for the source of a register transfer operation and uses a working register address for the target.
ps024502-1205preliminary register file zlr64400 rom mcu product specification 34 ?e y?? ??? ???21 ??1-??? 1?? ? 2 ??2 ? ?e? y??? ???? ?? 2? ???21 ??1-??? ?e 2 ??? ?????2? ?1?? ?2? ??2 ??2??? ?????-- ?e? ?e y??? ??? ???21 ??1-??? 1?? ? 2 ??2 ? ? ?? y?e ???? ?1? ??? o -???? ?2??? ?????-- ?e?e? ? ?? y??e ???? ? ??? o -???? ?2??? ?????-- ?e?e? ? ?e? ?? ???? ?2??? ?????-- ?e? ?2??2?- ???? 2? ????21 ??1-??? ?e 2 ??? ?????2? 1?? ?2? ???2 ??2??? ?????-- ??e? as can be seen in the above example, the source register is referenced via a linear address value contained within registers r6 and r7, whereas the destination is referenced via the srp setting and a working register. further explanation of the use of the ldx and ldxi instructions can be found in the z8 lxm cpu core user manual (um0183) . the lde and ldei instructions that existed in the z8 cpu are no longer valid; they have been replaced by the ldx and ldxi instructions. note:
ps024502-1205preliminary register file zlr64400 rom mcu product specification 35 figure 11. register file ldx, ldxi linear 12-bit address map ports 000h ? 003h general registers typical stack cpu control purpose bank 0 banks 1 ? 3 reserved peripheral d00h ? d0fh bank d control reserved peripheral f00h ? f0fh bank f control not to scale general purpose registers 004h ? 0efh 100h ? 3ffh d10h ? dffh below 0d0h 0f0h ? 0ffh f10h ? fffh
ps024502-1205preliminary register pointer register zlr64400 rom mcu product specification 36 register pointer register the upper nibble of the register pointer (see table 16 ) selects which working register group, of 16 bytes in the register file, is accessed out of the possible 256. the lower nibble selects the expanded register file bank and, in the case of the crimzon ? zlr64400 mcu family, banks 0, 1, 2, 3, f, and d are implemented. a e? in the lower nibble allows the normal register file (bank 0) to be addressed. any other value from e?? to e? exchanges the lower 16 registers to an expanded register bank. see table 16 . table 16. register pointer register (rp) bit 7 6 5 4 3 2 1 0 field working register group pointerregister bank pointer reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: fdh; linear 0fdh bit positionvaluedescription [7:4] 0h ? fh working register group pointer determines which 16-byte working group is addressed. [3:0] 0h ? fh register bank pointer determines which bank is active.
ps024502-1205preliminary user data register zlr64400 rom mcu product specification 37 user data register bank-independent register feh is available for user data storage. see table 17 . do not use register feh as a counter for the djnz instruction. stack pointer register the stack pointer register contains the 8-bit address of the stack pointer. the stack pointer resides in bank 0 of ram. the stack address is decremented prior to a push operation and incremented after a pop operation. the stack address always points to the data stored at the ? top ? of the stack (the lowest stack address). during a call instruction, the contents of the pro- gram counter are saved on the stack. interrupts cause the contents of the program counter and flags registers to be saved on the stack. an overflow or underflow can occur when the stack address is incremented or decremented during normal operations. the programmer must prevent this occurrence or unpredictable operations will result. see table 18 . table 17. user data register (user) bit 7 6 5 4 3 2 1 0 field user data reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: feh; linear: 0feh bit positionvaluedescription [7:0]00h ? ffhuser data table 18. stack pointer register (spl) bit 7 6 5 4 3 2 1 0 field stack pointer reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: ffh; linear: 0ffh bit positiondescription [7:0]stack pointer note:
ps024502-1205preliminary register file summary zlr64400 rom mcu product specification 38 register file summary table 19 maps each linear (12-bit) register file address to the associated register, mne- monic, and reset value. the table also lists the register bank (or banks) and corresponding 8-bit address, if any, for each register, plus a page link to the detailed register diagram. throughout this book, an ? x ? in a number denotes an undefined digit. a ??? (dash) in a table cell indicates that the corresponding attribute does not apply to the listed item. reset value digits highlighted in grey are not reset by a stop-mode recovery. register bit smr[7] (shown in boldface ) is set to 1 instead of reset by a stop-mode recovery. table 19. register file address summary address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage # 0000 ? 300port 0p0 xxh 22 0010 ? 301reserved ? ? ? 0020 ? 302port 2p2 xxh 24 0030 ? 303port 3p3 0xh 26 004 ? 00f004 ? 0fgeneral-purpose registers (bank 0 only) ? xxh ? 010 ? 0ef0,d,f10 ? efgeneral-purpose registers (banks 0, d, f) ? xxh ? 0f0allf0reserved--- --- --- 0f1allf1uart receive/transmit data registerurdata/ utdata xxh 51 0f2allf2uart status registerust 0000_0010b 52 0f3allf3uart control registeructl 00h 53 0f4allf4uart baud rate generator constantbcnst ffh 54 0f5allf5reserved ? ? ? 0f6allf6port 2 mode registerp2m ffh 23 0f7allf7port 3 mode registerp3m x x x x _ x 0 0 0b 25 0f8allf8port 0 mode registerp01m x1xx_xxx1b 21 0f9allf9interrupt priority registeripr xxh 87 0faallfainterrupt request registerirq 00h 89 0fballfbinterrupt mask registerimr 0xxx_xxxxb 86 0fcallfcflags registerflags xxh 114
ps024502-1205preliminary register file summary zlr64400 rom mcu product specification 39 0fdallfdregister pointerrp 00h 36 0feallfeuser data registeruser xxh 37 0ffallffstack pointer registerspl xxh 37 100 ? 103 ?? general-purpose registers (12-bit only) ? xxh ? 104 ? 1ef104 ? efgeneral-purpose registers ? xxh ? 1f0 ? 203 ?? general-purpose registers (12-bit only) ? xxh ? 204 ? 2ef204 ? efgeneral-purpose registers ? xxh ? 2f0 ? 303 ?? general-purpose registers (12-bit only) ? xxh ? 304 ? 3ef304 ? efgeneral-purpose registers ? xxh ? 3f0 ? 3ff ?? general-purpose registers (12-bit only) ? xxh ? 400 ? cff ?? reserved ? ? ? d00d00counter/timer 8 control registerctr0 000 0_ 0 0 00b 74 d01d01timer 8 and timer 16 common functionsctr1 00 0 0_0000b 76 d02d02counter/timer 16 control registerctr2 000 0_ 0 000b 79 d03d03timer 8/timer 16 control registerctr3 00 0 0_ 0xxxb 80 d04d04counter/timer 8 low hold registertc8l 00h 73 d05d05counter/timer 8 high hold registertc8h 00h 73 d06d06counter/timer 16 low hold registertc16l 00h 72 d07d07counter/timer 16 high hold registertc16h 00h 72 d08d08timer 16 capture low registerlo16 00h 71 d09d09timer 16 capture high registerhi16 00h 71 d0ad0atimer 8 capture low registerlo8 00h 70 d0bd0btimer 8 capture high registerhi8 00h 70 d0cd0clow-voltage detection registerlvd 1111_1000b 95 d0d ? d0fd0d ? 0freserved ? ? ? d10 ? dff ?? reserved (8-bit access goes to bank 0) ? ? ? f00f00port configuration registerpcon x x x x _ x 1 x 0b 20 f01 ? f09f01 ? 09reserved ? ? ? table 19. register file address summary (continued) address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage #
ps024502-1205preliminary register file summary zlr64400 rom mcu product specification 40 f0af0astop-mode recovery register 4smr4 x x x 0 _ 0 0 0 0b 108 f0bf0bstop-mode recovery registersmr 0 0 1 0_ 0 0 00 b 99 f0cf0cstop-mode recovery register 1smr1 00h 102 f0df0dstop-mode recovery register 2smr2 x 0 x 0 _ 0 0 x xb 104 f0ef0estop-mode recovery register 3smr3 x0h 107 f0ff0fwatch-dog timer mode registerwdtmr x x x x _ 1 1 0 1b 109 f10 ? fff ?? reserved (8-bit access goes to bank 0) ? ? ? table 19. register file address summary (continued) address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage #
ps024502-1205preliminary infrared learning amplifier zlr64400 rom mcu product specification 41 infrared learning amplifier the zlr64400 mcu ? s infrared learning amplifier allows the user to detect and decode infrared transmissions directly from the output of the receiving diode without the need for external circuitry. see port 3 on page 14 . an ir diode can be connected to the ir amp as shown in figure 12 . when the ir amp is enabled and an input current is detected on port 3, pin 1 (p31), the ir amp outputs a logi- cal high value. when the input current is below the switching threshold of the ir amp, the amp outputs a logical low value. within the mcu, the ir amp output goes to the capture/timer logic, which can be pro- grammed to demodulate the ir signal. the ir amp output can also be read by the cpu, or drive the port 3, pin 4 (p34) output if write-only register bit pcon[0] is written with a 1. the ir learning amp can demodulate signals up to a frequency of 500 khz. a special mode exists that allows the user to capture the third, fourth, and fifth edges of the ir amp output and generate an interrupt. see timers on page 56 for details about programming the timers to demodulate a received signal. figure 12. learning amplification circuitry with the zlr64400 mcu v cc d1 photodiode p31 of mcu
ps024502-1205preliminary uart zlr64400 rom mcu product specification 42 uart the universal asynchronous receiver/transmitter (uart) is a full-duplex communica- tion channel capable of handling asynchronous data transfers. the two uarts use a single 8-bit data mode with selectable parity. features of the uarts include: ? 8-bit asynchronous data transfer ? selectable even- and odd-parity generation and checking ? one or two stop bits ? separate transmit and receive interrupts ? framing, overrun, and break detection ? separate transmit and receive enables ? 8-bit baud rate generator (brg) ? baud rate generator timer mode ? uart operational during halt mode architecture the uarts consist of three primary functional blocks: transmitter, receiver, and baud rate generator. the uart transmitter and receiver function independently, but employ the same baud rate and data format. figure 13 illustrates the uart architecture. table 20. uart control registers address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage # 0f1allf1uart receive/transmit data registerurdata/ utdata xxh 51 0f2allf2uart status registerust 0000_0010b 52 0f3allf3uart control registeructl 00h 53 0f4allf4uart baud rate generator constantbcnst ffh 54
ps024502-1205preliminary operation zlr64400 rom mcu product specification 43 operation the uart channel can be used to communicate with a master microprocessor or as a slave microprocessor, both of which exhibit transmit and receive functionality. a user can either operate the uart channel by polling the uart status register or via interrupts. the uart remains active during halt mode. if neither the transmitter nor the receiver is enabled, the uart baud rate generator can be used as an additional timer. the uart contains a noise filter for the receiver that can be enabled by the user. data format the uart always transmits and receives data in an 8-bit data format, with the least-sig- nificant bit occurring first. an even or odd parity bit can be optionally added to the data stream. each character begins with an active low start bit and ends with either 1 or 2 active high stop bits. figures 14 and 15 illustrate the asynchronous data format employed by the uarts without parity and with parity, respectively. figure 13. uart block diagram receive shifter parity generator status register transmitter control transmit shift register receive data register transmit data register baud rate generator control registers rxd system bus txd
ps024502-1205preliminary operation zlr64400 rom mcu product specification 44 transmitting data using the polled method follow the steps below to transmit data using the polled method of operation: 1.write to the baud rate generator constant (bcnst) register, address e? , to set the appropriate baud rate. 2.write a 0 to bit 6 of the p01m register. 3.write to the uart control register (uctl) to: a.set the transmit enable bit, uctl[7], to enable the uart for data transmission. b.if parity is appropriate, set the parity enable bit, uctl[4] to 1 and select either even or odd parity (uctl[3]). 4.check the transmit status register bit, ust[2], to determine if the transmit data reg- ister is empty (indicated by a 1). if empty, continue to step 6. if the transmit data reg- ister is full (indicated by a 0), continue to monitor the ust[2] bit until the transmit data register becomes available to receive new data. 5.write the data byte to the uart transmit data register, e?? . the transmitter auto- matically transfers the data to the internal transmit shift register and transmits the data. 6.to transmit additional bytes, return to step 4. figure 14. uart asynchronous data format without parity figure 15. uart asynchronous data format with parity 1 1 lsbmsb 0 2 idle state of line stop bit(s) data field bit 0bit 1bit 2bit 3bit 4bit 5bit 6bit 7 start 1 1 lsbmsb 0 2 idle state of line stop bit(s) data field bit 0bit 1bit 2bit 3bit 4bit 5bit 6bit 7bit 7 start
ps024502-1205preliminary operation zlr64400 rom mcu product specification 45 7.before disabling the transmitter, read the transmit completion status bit, ust[1]. if ust[1]=0, continue to monitor the bit until it changes to 1, which indicates that all data in the transmit data and internal shift registers has been transmitted. data written while the transmit enable bit is clear (uctl[7]=0) will not be transmitted. data written while the transmit data status bit is clear (ust[2]=0) overwrites the previ- ous value written, so the previous written value will not be transmitted. disabling the uart transmitter while the transmit completion status bit is clear (ust[1]=0) can cor- rupt the byte being transmitted. transmitting data using the interrupt-driven method the uart transmitter interrupt indicates the availability of the transmit data register to accept new data for transmission. follow these steps to configure the uart for interrupt- driven data transmission: 1.write to the bcnst register to set the appropriate baud rate. 2.write a 0 to bit 6 of the p01m register. 3.execute a di instruction to disable interrupts. 4.write to the interrupt control registers to enable the uart transmitter interrupt and set the appropriate priority. 5.write to the uart control register to: a.set the transmit enable bit (uctl bit 7) to enable the uart for data transmission. b.enable parity, if appropriate, and select either even or odd parity. 6.execute an ei instruction to enable interrupts. 7.because the transmit buffer is empty, an interrupt is immediately executed. 8.write the data byte to the uart transmit data register. the transmitter automatically transfers the data to the internal transmit shift register and transmits the data. 9.execute the iret instruction to return from the interrupt-service routine and wait for the transmit data register to again become empty. 10.before disabling the transmitter, read the transmit completion status bit, ust[1]. if ust[1]=0, continue to monitor the bit until it changes to 1, which indicates that all data in the transmit data and internal shift registers has been transmitted. data written while the transmit enable bit is clear (uctl[7]=0) will not be transmitted. data written while the transmit data status bit is clear (ust[2]=0) overwrites the previ- ous value written, so the previous written value will not be transmitted. disabling the uart transmitter while the transmit completion status bit is clear (ust[1]=0) can cor- rupt the byte being transmitted. caution: caution:
ps024502-1205preliminary operation zlr64400 rom mcu product specification 46 receiving data using the polled method follow these steps to configure the uart for polled data reception: 1.write to the bcnst register to set the appropriate baud rate. 2.write to the uart control register (uctl) to: a.set the receive enable bit (uctl[6]) to enable the uart for data reception b.enable parity, if appropriate and select either even or odd parity 3.check the receive status bit in the uart status register, bit ust[7], to determine if the receive data register contains a valid data byte (indicated by a 1). if ust[7] is set to 1 to indicate available data, continue to step 4. if the receive data register is empty (indicated by a 0), continue to monitor the ust[7] bit awaiting reception of the valid data. 4.read data from the uart receive data register. 5.return to step 3 to receive additional data. receiving data using the interrupt-driven method the uart receiver interrupt indicates the availability of new data (as well as error condi- tions). follow these steps to configure the uart receiver for interrupt-driven operation: 1.write to the uart brg constant registers to set the appropriate baud rate. 2.execute a di instruction to disable interrupts. 3.write to the interrupt control registers to enable the uart receiver interrupt and set the appropriate priority. 4.clear the uart receiver interrupt in the applicable interrupt request register. 5.write to the uart control register (uctl) to: a.set the receive enable bit (uctl[6]) to enable the uart for data reception b.enable parity, if appropriate, and select either even or odd parity 6.execute an ei instruction to enable interrupts. the uart is now configured for interrupt-driven data reception. when the uart receiver interrupt is detected, the associated interrupt service routine (isr) performs the following: 1.checks the uart status register to determine the source of the interrupt, whether it is an error, break, or received data. 2.reads the data from the uart receive data register if the interrupt was caused by data available. 3.clears the uart receiver interrupt in the applicable interrupt request register.
ps024502-1205preliminary operation zlr64400 rom mcu product specification 47 4.executes the iret instruction to return from the interrupt service routine and await more data. uart interrupts the uart features separate interrupts for the transmitter and the receiver. in addition, when the uart primary functionality is disabled, the baud rate generator can also func- tion as a basic timer with interrupt capability. when the uart is set to run at higher baud rates, the uart receiver ? s service routine might not have enough time to read and manipulate all bits in the uart status register (especially bits generating error conditions) for a received byte before the next byte is received. users are encouraged to devise their own hand-shaking protocol to prevent the transmitter from transmitting more data while current data is being serviced. transmitter interrupts the transmitter generates a single interrupt when the transmit status bit, ust[2], is set to 1. this indicates that the transmitter is ready to accept new data for transmission. the transmit status interrupt occurs after the internal transmit shift register has shifted the first bit of data out. at this point, the transmit data register can be written with the next char- acter to send. this provides 7 bit periods of latency to load the transmit data register before the transmit shift register completes shifting the current character. writing to the uart transmit data register clears the ust[2] bit to 0. the interrupt is cleared by writ- ing a 0 to the transmit data register. receiver interrupts the receiver generates an interrupt when any of the following occurs: ? a data byte has been received and is available in the uart receive data register. this interrupt can be disabled independent of the other receiver interrupt sources. the received data interrupt occurs once the receive character has been received and placed in the receive data register. software must respond to this received data available condition before the next character is completely received to avoid an overrun error. the interrupt is cleared by reading from the uart receive data register. ? a break is received. a break is detected when a 0 is sent to the receiver for the full byte plus the parity and stop bits. after a break is detected, it will interrupt immediately if there is no valid data in the receive data register. if data is present in the receive data register, an interrupt will occur after the uart receive data register is read. ? an overrun is detected. an overrun occurs when a byte of data is received while there is valid data in the uart receive data register that has not been read by the user. the interrupt will be generated when the user reads the uart receive data register. the interrupt is cleared by reading the uart receive data register. when an overrun note:
ps024502-1205preliminary operation zlr64400 rom mcu product specification 48 error occurs, the additional data byte will not overwrite the data currently stored in the uart receive data register. ? a data framing error is detected. a data framing error is detected when the first stop bit is 0 instead of 1. when configured for 2 stop bits, a data framing error is only detected when the first stop bit is 0. a framing error interrupt is generated when the framing error is detected. reading the uart receive data register clears the interrupt. it is important to ensure that the transmitter uses the same stop bit configuration as the receiver. uart overrun errors when an overrun error condition occurs the uart prevents overwriting of the valid data currently in the receive data register. the break detect and overrun status bits are not displayed until after the valid data has been read. after the valid data has been read, the uart status (ust) register is updated to indicate the overrun condition (and break detect, if applicable). the ust[7] bit is set to 1 to indi- cate that the receive data register contains a data byte. however, because the overrun error occurred, this byte may not contain valid data and should be ignored. the break detect bit, ust[3], indicates if the overrun was caused by a break condition on the line. after reading the status byte indicating an overrun error, the receive data register must be read again to clear the error bits is the uart status 0 register. updates to the receive data register occur only when the next data word is received. uart data and error handling procedure figure 16 illustrates the recommended procedure for use in uart receiver interrupt ser- vice routines. note:
ps024502-1205preliminary operation zlr64400 rom mcu product specification 49 baud rate generator interrupts if the baud rate generator (brg) interrupt enable is set, the uart receiver interrupt asserts when the uart baud rate generator reloads. this action allows the baud rate generator to function as an additional counter if the uart functionality is not employed. uart baud rate generator the uart baud rate generator creates a lower frequency baud rate clock for data trans- mission. the input to the baud rate generator is the system clock. the uart baud rate constant register contains an 8-bit baud rate divisor value (bcnst[7:0]) that sets the data figure 16. uart receiver interrupt service routine flow receiver ready receiver interrupt read status errors? discard data read data that clears the rda bit and resets the error bits read data no yes
ps024502-1205preliminary operation zlr64400 rom mcu product specification 50 transmission rate (baud rate) of the uart. for programmed register values other than ee? , the uart data rate is calculated using the following equation: when the uart baud rate low register is programmed to ee? , the uart data rate is calculated as follows: when the uart baud rate generator is used as a general-purpose counter, the counters time out period can be computed as follows based upon the counters clock input being a divide by 16 of the system clock and the maximum count value being 255: in general, the system clock frequency is the xtal clock frequency divided by 2. when the uart is disabled, the baud rate generator can function as a basic 8-bit timer with interrupt on time-out. to configure the baud rate generator as a timer with interrupt on time-out, perform the following procedure: 1.disable the uart by clearing the receive and transmit enable bits, uctl[7:6] to 0. 2.load the appropriate 8-bit count value into the uart baud rate generator constant register. the count frequency is the system clock frequency in hz divided by 16. 3.enable the baud rate generator timer function and associated interrupt by setting the baud rate generator bit (uctl bit 0) in the uart control register to 1. when con- figured as an 8-bit timer, the count value, instead of the reload value, is read, and the counter begins counting down from its initial programmed value. upon timing out (reaching a value of 1), if the time-out interrupt is enabled, an interrupt will be pro- duced. the counter will then reload its programmed start value and begin counting down again. uart data rate (bits/s)= system clock frequency (hz) 16 x uart baud rate divisor value (bcnst) uart data rate (bits/s)= system clock frequency (hz) 4096 time out period: (us)= 16 x uart baud rate divisor value (bcnst) system clock frequency (mhz) note:
ps024502-1205preliminary uart receive data register/uart transmit zlr64400 rom mcu product specification 51 table 21 lists a number of bcnst register settings at various baud rates and system clock frequencies. uart receive data register/uart transmit data register the uart receive/transmit data register is used to send and retrieve data from the uart channel. when the uart receives a byte of data, it can be read from this register. the uart receive interrupt is cleared when this register is used. data written to this reg- ister is transmitted by the uart. see table 22 . table 21. bcnst register settings examples target uart data rate (baud) system clock = 4 mhz, crystal clock = 8 mhz system clock = 3 mhz, crystal clock = 6 mhz 2400bcnst = 01101000 actual baud rate = 2403 bcnst = 01001110 actual baud rate = 2403 4800bcnst = 00110100 actual baud rate = 4807 bcnst = 00100111 actual baud rate = 4807 9600bcnst = 00011010 actual baud rate = 9615 bcnst = 00010100 actual baud rate = 9375 19200bcnst = 00001101 actual baud rate = 19230 bcnst = 00001010 actual baud rate = 18750 table 22. uart receive/transmit data register (urdata/utdata) bit 7 6 5 4 3 2 1 0 field uart receive/transmit reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: f1h; linear: 0f1h bit positiondescription [7:0]uart receive/transmit when read, returns received data. when written, transmits written data.
ps024502-1205preliminary uart status register zlr64400 rom mcu product specification 52 uart status register the uart status register shows the status of the uart. bits [6:3] are cleared by reading the uart receive/transmit register ( ?? ). see table 23 . table 23. uart status register (ust) bit 7 6 5 4 3 2 1 0 field receive status parity error overrun error framing error breaktransmit data transmit complete noise filter reset 00000010 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: f2h; linear: 0f2h bit positionvaluedescription [7] 0 1 receive status ? set when data is received; cleared when urdata is read. uart receive data register empty. uart receive data register full. [6] 0 1 parity ? set when a parity error occurs; cleared when urdata is read. no parity error occurs. parity error occurs. [5] 0 1 overrun ? set when an overrun error occurs; cleared when urdata is read. no overrun error occurs. overrun error occurs. [4] 0 1 framing ? set when a framing error occurs; cleared when urdata is read. no framing error occurs. framing error occurs. [3] 0 1 break ? set when a break is detected; cleared when urdata is read. no break occurs. break occurs. [2] 0 1 transmit data status ? set when the uart is ready to transmit; cleared when trdata is written. do not write to the uart transmit data register. uart transmit data register ready to receive additional data. [1] 0 1 transmit completion status data is currently transmitting. transmission is complete.
ps024502-1205preliminary uart control register zlr64400 rom mcu product specification 53 uart control register as its name implies, the uart register controls the uart. in addition to setting bit 5, the user must also set appropriate bit in the interrupt mask register ( table 44, interrupt mask register (imr), on page 89 ). see table 24 . this register is not reset after a stop-mode recovery. [0] read: 0 1 noise filter ? detects noise during data reception. no noise detected. noise detected. write: 0 1 turn off noise filter. turn on noise filter. table 24. uart control register (uctl) bit 7 6 5 4 3 2 1 0 field transmitter enable receiver enable uart interrupts enable parity enable parity select send break stop bitsbaud rate generator reset 0 0 0 0 0 0 0 0 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: f3h; linear: 0f3h bit positionvaluedescription [7] 0 1 transmitter disabled. transmitter enabled. [6] 0 1 receiver disabled. receiver enabled. [5] 0 1 uart interrupts disabled. uart interrupts enabled. [4] 0 1 parity disabled. parity enabled. [3] 0 1 even parity selected. odd parity selected. bit positionvaluedescription note:
ps024502-1205preliminary baud rate generator constant register zlr64400 rom mcu product specification 54 baud rate generator constant register the uart baud rate generator determines the frequency at which uart data is received and transmitted. this baud rate is determined by the following formula: the system clock is usually the crystal clock divided by 2. when the uart baud rate generator is used as an additional timer, a read from this regis- ter will return the actual value of the count of the brg in progress and not the reload value. see table 25 . this register is not reset after a stop-mode recovery. [2]0 1 no break is sent. send break (force tx output to 0). [1] 0 1 one stop bit. two stop bits. [0] 0 1 baud rate generator ? when the transmitter and receiver are disabled, the brg can be used as an additional timer. when setting this bit, clear bits [7:6] in this register. also set bit [5] if an interrupt is desired when the brg is reloaded. brg used as baud rate generator for uart. brg used as timer. uart data rate (bits/s)= system clock frequency (hz) 16 x uart baud rate divisor value (bcnst) table 25. baud rate generator constant register (bcnst) bit 7 6 5 4 3 2 1 0 field baud rate generator constant reset 1 1 1 1 1 1 1 1 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: f4h; linear: 0f4h bit positiondescription bit positionvaluedescription note:
ps024502-1205preliminary baud rate generator constant register zlr64400 rom mcu product specification 55 [7:0] brg constant when read, returns the actual timer count value (when uctl[0]=1). when written, sets the baud rate generator constant. the actual baud rate frequency = xtal (32 x bcnst ).
ps024502-1205preliminary timers zlr64400 rom mcu product specification 56 timers the crimzon ? zlr64400 mcu infrared timer contains a 16-bit and an 8-bit counter/ timer, each of which can be used simultaneously for transmitting. in addition, both timers can be used for demodulating an input carrier wave. both timers share a single input pin. figure 17 on page 56 illustrates the counter/timer architecture, which is designed to help unburden the program from coping with such real-time problems as generating complex waveforms or receiving and demodulating complex waveforms and pulses. in addition to the 16-bit and 8-bit timers, the uart ? s baud rate generator can be used as an additional 8-bit timer when the uart receiver is not in use. see uart on page 42 . figure 17. counter/timers block diagram ????? y??y?? ??? y?y? t? 3?? ?t? 3?? ? 3?? ? 3?? ?? y?? 3?? ???? ?1? y? a??? ???? ??? ??1? ????? y???? ? ??
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 57 table 26 summarizes the registers used to control timers. some timer functions can also be affected by control registers for other peripheral functions. counter/timer functional blocks the crimzon ? zlr64400 mcu infrared timer contains a glitch filter for removing noise from the input when demodulating an input carrier. each timer features its own demodu- lating mode. the t8 timer has the ability to capture only one cycle of a carrier wave of a high-frequency waveform. each timer can be simultaneously used to generate a signal output. input circuit depending on the setting of register bits p3m[2:1] and ctr1[6], the timer/counter input monitors one of the following conditions: ? the p31 digital signal, if ctr1[6]=0 and p3m[2:1]=00. ? the p31 analog comparator output, if ctr1[6]=0 and p3m[2:1]=01. ? the p31 ir amplifier output, if ctr1[6]=0 and p3m[2]=1. ? the p20 digital signal, if ctr16=1. table 26. timer control registers address (hex) 12-bitbank8-bitregister descriptionmnemonicresetpage # d00d00counter/timer 8 control registerctr0 000 0_ 0 0 00b 74 d01d01timer 8 and timer 16 common functionsctr1 00 0 0_0000b 76 d02d02counter/timer 16 control registerctr2 000 0_ 0 000b 79 d03d03timer 8/timer 16 control registerctr3 00 0 0_ 0xxxb 80 d04d04counter/timer 8 low hold registertc8l 00h 73 d05d05counter/timer 8 high hold registertc8h 00h 73 d06d06counter/timer 16 low hold registertc16l 00h 72 d07d07counter/timer 16 high hold registertc16h 00h 72 d08d08timer 16 capture low registerlo16 00h 71 d09d09timer 16 capture high registerhi16 00h 71 d0ad0atimer 8 capture low registerlo8 00h 70 d0bd0btimer 8 capture high registerhi8 00h 70
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 58 based on register bits ctr1[5:4], a pulse is generated at when a rising edge, falling edge, or any edge is detected. glitches in the input signal are filtered out if they are shorter than the glitch filter width specified in register bits ctr1[3:2]. the input circuit is illustrated in figure 18 . t8 transmit mode before t8 is enabled, the output of t8 depends on ctr1, bit 1. if it is 0, t8_out is 1; if it is 1, t8_out is 0. see figure 19 . figure 18. counter/timer input circuit ???? ??? y?? ??-??a?? y?? ee ?e ?? e? ??1? ?????2 y???e? y????? ee e? ????-??a?? ?e ??21 ??1? ?-21 ??1? e? y3? ? ?3? ee ?? e?e e ? p ? p ? e ? y?????? y?????? y???? e??? e??? e ?
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 59 figure 19. transmit mode flowchart ??? y? ??-?? ?? ??? y? ?? ?? ?2??? ??- ?? 3???? ????- t? ?y?e? ?? ? ?2? 1?2????? ??? o ?2???? ? e ?t? ??2-3? ?? ?2??? t? ?? y?e? ?? ??- y??? ?? ? ??? ? ??? y? ??-?? ?? ??? y? ?? ?? ?2??? ??-?? ??t?? t? ?? 3???? ????- t? ?y?e ?? ? ?2? 1?2????? ??? o ?2???? ??? ??- ??- 21? e?-- ?? 21? e?-- e ?? ??? ???
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 60 when t8 is enabled, the output t8_out switches to the initial value (ctr1, bit 1). if the initial value (ctr1, bit 1) is 0, tc8l is loaded; otherwise, tc8h is loaded into the counter. in single-pass mode (ctr0, bit 6), t8 counts down to 0 and stops, t8_out toggles, the time-out status bit (ctr0, bit 5) is set, and a time-out interrupt can be gener- ated if it is enabled (ctr0, bit 1). in modulo-n mode, upon reaching terminal count, t8_out is toggled, but no interrupt is generated. from that point, t8 loads a new count (if the t8_out level now is 0), tc8l is loaded; if it is 1, tc8h is loaded. t8 counts down to 0, toggles t8_out, and sets the time-out status bit (ctr0, bit 5), thereby gener- ating an interrupt if enabled (ctr0, bit 1). one cycle is thus completed. t8 then loads from tc8h or tc8l according to the t8_out level and repeats the cycle. see figure 20 . you can modify the values in tc8h or tc8l at any time. the new values take effect when they are loaded. an initial count of 1 is not allowed (a non-function occurs). an initial count of 0 causes tc8 to count from 0 to ? to ?? . the ? h ? suffix denotes hexadecimal values. transition from 0 to ? is not a time-out condition. figure 20. 8-bit counter/timer circuits ??v ??? t?- ??v ??? t?- e-?a? ??1? ?1??a? ??1? y?e ???? ?? ? ?? y?e ???? ?? ? ?? y? y? y? ???? y?? y?e ???? ??- ??? y? ? ?? t? y?2??? ?y caution: note: note:
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 61 using the same instructions for stopping the counter/timers and setting the status bits is not recommended. two successive commands are necessary. first, the counter/timers must be stopped. sec- ond, the status bits must be reset. these commands are required because it takes one counter/timer clock interval for the initiated event to actually occur. see figures 21 and 22 . t8 demodulation mode the user must program tc8l and tc8h to ? . after t8 is enabled, when the first edge (rising, falling, or both depending on ctr1 bits [5:4]) is detected, it starts to count down. when a subsequent edge (rising, falling, or both depending on ctr1 bits [5:4]) is detected during counting, the current value of t8 is complemented and put into one of the capture registers. if it is a positive edge, data is put into lo8; if it is a negative edge, data is put into hi8. from that point, one of the edge detect status bits (ctr1, bits [1:0]) is set, and an interrupt can be generated if enabled (ctr0, bit 2). meanwhile, t8 is loaded with ? figure 21. t8_out in single-pass mode figure 22. t8_out in modulo-n mode caution: y? y?2?- y?2??? ?2??? ?33?2?? ?? -?????- ? ?- 2?? a??? ?y?? ???? ?? ? ?? ?11?-? ?3??? 2?????? y?2??? ?2??? ?33?2?? ??? -?????- ? ?- 2?? a??? ?y?? ???? ?? ? ?? ?11?- ??y?y?y?y?y? 3??? 2?????? 3??? 2??????
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 62 and starts counting again. if t8 reaches 0, the time-out status bit (ctr0, bit 5) is set, and an interrupt can be generated if enabled (ctr0, bit 1). t8 then continues counting from ? . see figure 23 . when bit 4 of ctr3 is enabled, the flow of the demodulation sequence is altered. the third edge makes t8 active, and the fourth and fifth edges are captured. the capture inter- rupt is activated after the fifth event occurs. this mode is useful for capturing the carrier figure 23. demodulation mode count capture flowchart ??? y?2? y????? ?2??? ??? t ?-?? ??- ??1? e??-?2? ??- ??? ?2? ?o ??1? e- ?? ?1 ? ?
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 63 duty cycle as well as the frequency at which the first cycle is corrupted. see figures 24 and25 . figure 24. demodulation mode flowchart ?t? ?3????2 ?? ?2??? y?e? ??- ?-? ??1? e??-?2? ?2??? t? ?? ??- ?? ??1? e??-?2? ????- t? ?2? ?11?? ??? y????? 2? o ?2???? ? y ??- ?2??? y ??1? e??-?2? -??? ??- 3? ??? ??- ?? 3???? ????- t? ?2? ?11?? 3? ??? 2? o ?2???? y2?2?? y?2?21
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 64 figure 25. demodulation mode flowchart with bit 4 of ctr3 set ?t? ?3????2 ?? ?2??? y?e ?? ??- ??? ??1? e??-?2? ?2??? t? ?? ??- ? y ??- ?2??? y -??? ??- 3? ??? ??- ?? 3???? ????- t? ?2? ?11?? 3? ??? 2?????? o ?2???? y2?2?? y?2?21 o?? ??1? e??-?2? ??- ?? ??1? e??-?2? ????- y????? 2?????? o ?2???? ???? ??1? e??-?2? ?? ??1? e??-?2? ????- t? ?2? ?11?? ???
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 65 t16 transmit mode in normal or ping-pong mode, the output of t16 when not enabled, is dependent on ctr1, bit 0. if it is a 0, t16_out is a 1; if it is a 1, t16_out is 0. you can force the out- put of t16 to either a 0 or 1 whether it is enabled or not by programming ctr1 bits [3:2] to a 10 or 11. when bit 4 of ctr3 is set, the t16 output does not update. however, time-out interrupts (flags) are still updated. in addition, the t8 carrier is not disrupted by timing out of the t16 timer. when t16 is enabled, tc16h * 256 + tc16l is loaded, and t16_out is switched to its initial value (ctr1, bit 0). when t16 counts down to 0, t16_out is toggled (in nor- mal or ping-pong mode), an interrupt (ctr2, bit 1) is generated (if enabled), and a status bit (ctr2, bit 5) is set. see figure 26 . global interrupts override this function as described in the interrupts chapter on page 82 . if t16 is in single-pass mode, it is stopped at this point (see figure 27 ). if it is in modulo-n mode, it is loaded with tc16h * 256 + tc16l, and the counting continues (see figure 28 ). figure 26. 16-bit counter/timer circuits e-?a? ??1? ?1??a? ??1? y?? ???? ?? ? ?? y?? ???? ?? ? ??? y? y? y? ???? y?? y?? ???? ??- ??? y? ?t? y?2??? ? ?y? ?? ??? ??v ??? t?- ??v ??? t?- note:
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 66 you can modify the values in tc16h and tc16l at any time. the new values take effect when they are loaded. do not load these registers at the time the values are to be loaded into the counter/timer to ensure known operation. an initial count of 1 is not allowed. an initial count of 0 causes t16 to count from 0 to ?? . transition from 0 to ? is not a time-out con- dition. t16 demodulation mode the user must program tc16l and tc16h to ? . after t16 is enabled, and the first edge (rising, falling, or both depending on ctr1 bits [5:4]) is detected, t16 captures hi16 and lo16, reloads, and begins counting. if bit 6 of ctr2 is 0. when a subsequent edge (rising, falling, or both depending on ctr1 bits [5:4]) is detected during counting, the current count in t16 is complemented and put into hi16 and lo16. when data is captured, one of the edge detect status bits figure 27. t16_out in single-pass mode figure 28. t16_out in modulo-n mode caution: y?? ? ?? ? y?? y?2?- y?2??? ?2??? ?33?2?? ???? -?????- ? ?- 2?? a??? ?y?? ???? ?? e ??? ?11?-? 3??? 2?????? y?? ? ?? ? y?? y?2??? ?2??? ?33?2?? ???? -?????- ? ?- 2?? a??? ?y?? ???? ?? e ??? ?11?-? 3??? 2?????? y?? ? ?? ? y?? y?? ? ?? ? y?? ??? ?11?-? 3??? 2?????? ???
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 67 (ctr1, bit 1; bit 0) is set, and an interrupt is generated if enabled (ctr2, bit 2). t16 is loaded with ? and starts again. this t16 mode is generally used to measure space time, the length of time between bursts of carrier signal (marks). if bit 6 of ctr2 is 1. t16 ignores the subsequent edges in the input signal and continues counting down. a time-out of t8 causes t16 to capture its current value and generate an interrupt if enabled (ctr2, bit 2). in this case, t16 does not reload and continues count- ing. if ctr2 bit 6 is toggled (by writing a 0 then a 1 to it), t16 captures and reloads on the next edge (rising, falling, or both depending on ctr1 bits [5:4]), continuing to ignore sub- sequent edges. this t16 mode generally measures mark time, the length of an active carrier signal burst. if t16 reaches 0, t16 continues counting from ? . meanwhile, a status bit (ctr2 bit 5) is set, and an interrupt time-out can be generated if enabled (ctr2 bit 1). ping-pong mode this operation mode is only valid in transmit mode. t8 and t16 must be programmed in single-pass mode (ctr0, bit 6; ctr2, bit 6), and ping-pong mode must be pro- grammed in ctr1 bits [3:2]. the user can begin the operation by enabling either t8 or t16 (ctr0, d7 or ctr2, d7). for example, if t8 is enabled, t8_out is set to this initial value (ctr1, bit 1). according to t8_out's level, tc8h or tc8l is loaded into t8. after the terminal count is reached, t8 is disabled, and t16 is enabled. t16_out then switches to its initial value (ctr1, bit 0), data from tc16h and tc16l is loaded, and t16 starts to count. after t16 reaches the terminal count, it stops, t8 is enabled again, repeat- ing the entire cycle. interrupts can be allowed when t8 or t16 reaches terminal control (ctr0, bit 1; ctr2, bit 1). to stop the ping-pong operation, write 00 to bits ctr1 bits [3:2]. see figure 29 . enabling ping-pong operation while the counter/timers are running might cause intermit- tent counter/timer function. disable the counter/timers and reset the status flags before instituting this operation. note:
ps024502-1205preliminary counter/timer functional blocks zlr64400 rom mcu product specification 68 initiating ping-pong mode first, ensure that both counter/timers are not running. set t8 into single-pass mode (ctr0, bit 6), set t16 into single-pass mode (ctr2, bit 6), and set the ping-pong mode (ctr1 bits [3:2]). these instructions are not consecutive and can occur in random order. finally, start ping-pong mode by enabling either t8 (ctr0, d7) or t16 (ctr2, d7). the initial value of t8 or t16 must not be ? . if you stop the timer and restart the timer, reload the initial value to avoid an unknown previous value. during ping-pong mode the enable bits of t8 and t16 (ctr0, d7; ctr2, d7) are set and cleared alternately by hardware. the time-out bits (ctr0, bit 5; ctr2, bit 5) are set every time the counter/tim- ers reach the terminal count. timer output the output logic for the timers is illustrated in figure 30 . p34 is used to output t8_out when bit 0 of ctr0 is set. p35 is used to output the value of t16_out when bit 0 of ctr2 is set. when bit 6 of ctr1 is set, p36 outputs the logic combination of t8_out and t16_out via bits [4:5] of ctr1. figure 29. ping-pong mode diagram ?2??? y 3???? ?2??? y? 3???? e21e21 y?? ???? ??- ????
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 69 counter/timer registers the following sections describe each of the timer/counter registers in detail. figure 30. output circuit e????? ?? y?? ???? ??- ???? e???? y?e ???? ?? e e???? y?? ???? ?? y?? ???? ?? e e? e e ??? ? y?? ???? ?? ? y?? ???? ?? ????????? ?1? ? ? ?
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 70 timer 8 capture high register the timer 8 capture high register holds the captured data from the output of the 8-bit counter/timer 0. typically, this register contains the number of counts when the input sig- nal is 1. this register is not reset after a stop-mode recovery. timer 8 capture low register the timer 8 capture low register holds the captured data from the output of the 8-bit counter/timer 0. typically, this register contains the number of counts when the input sig- nal is 0. this register is not reset after a stop-mode recovery. table 27. timer 8 capture high register (hi8) bit 7 6 5 4 3 2 1 0 field t8_capture_hi reset 0 0 0 0 0 0 0 0 r/w rrrrrrrr address bank d: 0bh; linear: d0bh bit positionvaluedescription [7:0]0hh ? ffht8_capture_hi ? reads return captured data. writes have no effect. table 28. timer 8 capture low register (l08) bit 7 6 5 4 3 2 1 0 field t8_capture_lo reset 0 0 0 0 0 0 0 0 r/w rrrrrrrr address bank d: 0ah; linear: d0ah bit positionvaluedescription [7:0]0hh ? ffht8_capture_lo ? read returns captured data. writes have no effect. note: note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 71 timer 16 capture high register the timer 16 capture high register holds the captured data from the output of the 16-bit counter/timer 16. this register contains the most significant byte (msb) of the data. this register is not reset after a stop-mode recovery. timer 16 capture low register the timer 16 capture low register holds the captured data from the output of the 16-bit counter/timer 16. this register contains the lsb of the data. this register is not reset after a stop-mode recovery. table 29. timer 16 capture high register (hi16) bit 7 6 5 4 3 2 1 0 field t16_capture_hi reset 0 0 0 0 0 0 0 0 r/w rrrrrrrr address bank d: 09h; linear: d09h bit positionvaluedescription [7:0]0hh ? ffht16_capture_hi ? read returns captured data. writes have no effect. table 30. timer 16 capture low register (l016) bit 7 6 5 4 3 2 1 0 field t16_capture_lo reset 0 0 0 0 0 0 0 0 r/w rrrrrrrr address bank d: 08h; linear: d08h bit positionvaluedescription [7:0]0hh ? ffht16_capture_lo ? read returns captured data. writes have no effect. note: note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 72 counter/timer 16 high hold register the counter/timer 16 high hold register contains the high byte of the value loaded into the t16 timer. this register is not reset after a stop-mode recovery. counter/timer 16 low hold register the counter/timer 16 low hold register contains the low byte of the value loaded into the t16 timer. this register is not reset after a stop-mode recovery. table 31. counter/timer 16 high hold register (tc16h) bit 7 6 5 4 3 2 1 0 field t16_data_hi reset 0 0 0 0 0 0 0 0 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 07h; linear: d07h bit positionvaluedescription [7:0]0hh ? ffht16_data_hi ? read/write data. table 32. counter/timer 16 low hold register (tc16l) bit 7 6 5 4 3 2 1 0 field t16_data_lo reset 0 0 0 0 0 0 0 0 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 06h; linear: d06h bit positionvaluedescription [7:0]0hh ? ffht16_data_lo ? read/write data. note: note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 73 counter/timer 8 high hold register the counter/timer 8 high hold register contains the value to be counted while the t8 output is 1. this register is not reset after a stop-mode recovery. counter/timer 8 low hold register the counter/timer 8 low hold register contains the value to be counted while the t8 output is 0. this register is not reset after a stop-mode recovery. table 33. counter/timer 8 high hold register (tc8h) bit 7 6 5 4 3 2 1 0 field t8_level_hi reset 0 0 0 0 0 0 0 0 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 05h; linear: d05h bit positionvaluedescription [7:0]0hh ? ffht8_level_hi ? read/write data. table 34. counter/timer 8 low hold register (tc8l) bit 7 6 5 4 3 2 1 0 field t8_level_lo reset 0 0 0 0 0 0 0 0 r/w bank d: 04h; linear: d04h address r/wr/wr/wr/wr/wr/wr/wr/w bit positionvaluedescription [7:0]0hh ? ffht8_level_lo ? read/write data. note: note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 74 counter/timer 8 control register the counter/timer 8 control register controls the timer function of the t8 timer. this bank d register is described in table 35 . writing a 1 to ctr0[5] is the only way to reset the terminal count status condition. re- set this bit before using/enabling the counter/timers. be careful when using the or or and commands to manipulate ctr0, bit 5 and ctr1, bits 0 and 1 (demodulation mode). these instructions use a read-modify-write se- quence in which the current status from the ctr0 and ctr1 registers is ored or and- ed with the designated value and then written back into the registers. example: when the status of bit 5 is 1, a timer reset condition occurs. table 35. counter/timer 8 control register (ctr0) bit 7 6 5 4 3 2 1 0 field t8_enable single/ modulo-n time_outt8 _clock capture_int_m ask counter_int_m ask p34_out reset 000 0 0 0 00 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 00h; linear: d00h bit positionvaluedescription [7] 0 1 t8_enable ? disable/enable the t8 counter. disable counter. enable counter. configure t8 properly before enabling it. [6] 0 1 single pass/modulo-n modulo-n mode. counter reloads the initial value when terminal count is reached single-pass mode. counter stops when the terminal count is reached [5]read: 0 1 write: 0 1 time_out ? this bit is set when the t8 terminal count is reached. no counter time-out occurs. counter time-out occurred. no effect. reset flag to 0. software must reset this flag before using counter/timers. caution: note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 75 [4:3] 00 01 10 11 t8 _clock ? select the t8 input clock frequency. these bits are not reset upon stop-mode recovery. sclk. sclk 2. sclk 4. sclk 8. [2] 0 1 capture_int_mask ? disable/enable interrupt when data is captured into either lo8 or hi8 upon a positive or negative edge detection in demodulation mode. this bit is not reset upon stop-mode recovery. disable data capture interrupt. enable data capture interrupt. [1] 0 1 counter_int_mask ? disable/enable t8 time-out interrupt. this bit is not reset upon stop-mode recovery. disable time-out interrupt. enable time-out interrupt. [0] 0 1 p34_out ? select normal i/o or t8 output function for port 3, pin 4. p34 as port output. t8 output on p34. bit positionvaluedescription
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 76 t8 and t16 common functions register the t8 and t16 common functions register (ctr1) controls the functions in common with timer 8 and timer 16. table 36 describes the bits for this register. be careful to differentiate transmit mode from demodulation mode, as set by ctr1[7]. the functions of ctr1[6:0] and ctr2[6] are different depending on which mode is selected. do not change from one mode to another without first disabling the counter/timers. table 36. timer 8 and timer 16 common functions register (ctr1) bit 7 6 5 4 3 2 1 0 field mode p36 out/ demodulator input t8/t16 logic/ edge detect transmit submode/ glitch filter initial timer 8 out/ rising edge initial timer 16 out/ falling edge reset 00 0 00000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 01h; linear: d01h bit positiondescription [7]mode ? selects the timer mode for signal transmission or demodulation. 0 1 transmit mode. demodulation mode. [6] transmit mode: p36 out ? select normal i/o or timer output on port 3, pin 6. 0 1 p36 acts as normal i/o port output. p36 acts as combined timer 8/timer 16 output. demodulation mode: demodulator input ? select port 2, pin 0 or port 3, pin 1 as the counter/timer input. 0 1 p31 acts as the demodulator input. if imr[2] = 1, a p31 event can also generate an irq1 interrupt. to prevent this, clear imr[2] or select p20 as input instead. p20 acts as the demodulator input. note:
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 77 [5:4] transmit mode: t8/t16 logic ? defines how the timer 8/timer 16 outputs are combined logically. these bits are not reset upon stop-mode recovery. 00 01 10 11 output is t8 and t16. output is t8 or t16. output is t8 nor t16. output is t8 nand t16. demodulation mode: edge detect ? define the behavior of the edge detector. 00 01 10 11 falling edge detection. rising edge detection. falling and rising edge detection. reserved. [3:2] transmit mode: submode selection ? select normal or ping-pong mode operation, or force t16 output. when these bits are written to 00b (normal mode) or 01b (ping-pong mode), t16_out assumes the opposite state of bit ctr1[0] until the timer begins counting. 00 01 10 11 normal operation. writing 00 terminates ping-pong mode, if it is active. ping-pong mode. force t16_out = 0. force t16_out = 1. demodulation mode: glitch filter ? define the maximum glitch width to be rejected by the counter/timer. 00 01 10 11 no filter. 4 sclk cycle filter. 8 sclk cycle filter. reserved. bit positiondescription
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 78 [1] transmit mode: initial timer 8 out ? select the initial t8_out state when timer 8 is enabled. while the timer is disabled, the opposite state is asserted on the pin to ensure that a transition occurs when the timer is enabled. changing this bit while the counter is enabled can cause unpredictable output on t8_out. 0 1 t8_out transitions from high to low when timer 8 is enabled. t8_out transitions from low to high when timer 8 is enabled. demodulation mode: rising edge ? indicates whether a rising edge was detected on the input signal. write 1 to this flag to reset it. read: 0 1 write: 0 1 no rising edge detection. rising edge detection. no effect. reset flag to 0. [0] transmit mode: initial timer 16 out ? in normal or ping-pong mode, this bit selects the initial t16_out state when timer 16 is enabled. while the timer is disabled, the opposite state is asserted on the pin to ensure that a transition occurs when the timer is enabled. changing this bit while the counter is enabled can cause unpredictable output on t16_out. 0 1 if ctr1[3]=0, t16_out transitions from high to low when timer 16 is enabled. if ctr1[3]=0, t16_out transitions from low to high when timer 16 is enabled. demodulation mode: falling edge ? indicates whether a falling edge was detected on the input signal. write 1 to this flag to reset it. read: 0 1 write: 0 1 no falling edge detection. falling edge detection. no effect. reset flag to 0. bit positiondescription
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 79 timer 16 control register table 37 describes the bits for the timer 16 control register (ctr2). table 37. counter/timer 16 control register (ctr2) bit 7 6 5 4 3 2 1 0 field t16_enable single/ modulo-n time_outt16 _clock capture_int _mask counter_int _mask p35_out reset 000 0 0 000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank d: 02h; linear: d02h bit positiondescription [7]t16_enable ? disable/enable the t16 counter. 0 1 disable t16 counter. enable t16 counter. [6] transmit mode (ctr1[7]=0): single/modulo-n ? selects timer 16 terminal count action. 0 1 modulo-n mode. t16 reloads the initial value when terminal count is reached single-pass mode. t16 stops when the terminal count is reached demodulation mode (ctr1[7]=1): enable single-edge capture. see t16 demodulation mode on page 66 . 0 1 timer 16 captures and reloads on all edges. timer 16 captures and reloads on first edge only. [5]time_out ? this bit is set when the t16 terminal count is reached. read: 0 1 write: 0 1 time_out ? this bit is set when the t16 terminal count is reached. no counter time-out occurs. counter time-out occurred. no effect. reset flag to 0. software must reset this flag before using counter/timers. [4:3] t16 _clock ? select t16 input clock frequency. these bits are not reset upon stop-mode recovery. 00 01 10 11 sclk. sclk 2. sclk 4. sclk 8.
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 80 timer 8/timer 16 control register the timer 8/timer 16 counter/timer register allows the t8 and t16 counters to be syn- chronized. it also can freeze the t16 output value and change t8 demodulation mode to capture one cycle of a carrier. table 38 briefly describes the bits for this bank d register. a description of each bit follows the table. [2] capture_int_mask ? disable/enable interrupt when data is captured into either lo16 or hi16 upon a positive or negative edge detection in demodulation mode. this bit is not reset upon stop-mode recovery. 0 1 disable data capture interrupt. enable data capture interrupt. [1]counter_int_mask ? disable/enable t16 time-out interrupt. 0 1 disable t16 time-out interrupt. enable t16 time-out interrupt. [0]p35_out ? select normal i/o or t8 output function for port 3, pin 5. 0 1 p35 as port output. p35 is t16 output. table 38. timer 8/timer 16 control register (ctr3) bit 7 6 5 4 3 2 1 0 field t16_enablet8_enablesync_mode t16_out disable t8 demodulate reserved reset 00 0 0 0xxx r/w r/wr/wr/wr/wr/w ??? address bank d: 03h; linear: d03h bit positionvaluedescription [7] 0 1 disable t16 counter. enable t16 counter. configure t16 properly before enabling it. [6]0 1 disable t8 counter. enable t8 counter. bit positiondescription
ps024502-1205preliminary counter/timer registers zlr64400 rom mcu product specification 81 [5]sync mode ? when enabled, the first pulse of timer 8 (the carrier) is always synchronized with timer 16 (the demodulated signal). it can always provide a full carrier pulse. this bit is not reset upon stop-mode recovery. 0 1 disable sync mode. enable sync mode. [4]t16_out disable ? set this bit to disable toggling of the timer 16 output. time-out interrupts are still generated. this bit is not reset upon stop-mode recovery. 0 1 t16 toggles normally. t16 toggle is disabled. [3] t8 demodulate ? (capture one cycle.) this bit is not reset upon stop-mode recovery. 0 1 t8 captures events normally. t8 becomes active on the third edge, captures events on the fourth and fifth edges, and generates an interrupt on the fifth edge. after a t8 time-out the event count resets to 0 and the fourth and fifth edges are captured again. [2:0]reserved ? always reads 111b. writes have no effect. bit positionvaluedescription
ps024502-1205preliminary interrupts zlr64400 rom mcu product specification 82 interrupts the crimzon ? zlr64400 mcu features six different interrupts (see table 40on page 84 ). the interrupts are maskable and prioritized (see figure 31 ). the six sources are divided as follows: three sources are claimed by port 3 lines p33:p31, two by the counter/ timers ( table 40 ) and one for low voltage detection. p32 and the uart receiver share the same interrupt. only one interrupt can be selected as a source. when the uart receiver is enabled p32 is no longer used as an interrupt source. the uart transmit interrupt and uart baud rate interrupt use the same interrupt as the p33 interrupt. the user selects which source triggers the interrupt. when bit 7 of utcl is 1, the uart transmit interrupt is the source. when bit 7 of uctl is 0 and bit 5 of uctl is 1, the brg interrupt is selected. the interrupt mask register (globally or individually) enables or disables the six interrupt requests. the source for irq1 is determined by bit 1 of the port 3 mode register (p3m) and bit 4 of the smr4 register. if p3m[1]=0 (digital mode) and smr4[4]=0, pin p33 is the irq1 source. if p3m[1]=1 (analog mode) or smr4[4]=1 (smr interrupt enabled), the output of the stop-mode recovery source logic is used as the source for the interrupt. see stop mode recovery interrupt on page 96 . table 39. interrupt control registers address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage # 0f9allf9interrupt priority registeripr xxh 87 0faallfainterrupt request registerirq 00h 89 0fballfbinterrupt mask registerimr 0xxx_xxxxb 86
ps024502-1205preliminary interrupts zlr64400 rom mcu product specification 83 figure 31. interrupt block diagram ?y? ??- ? ? ?? ?? ??1-??? ???- 2?????? ????-? 2?????? ?- ??1-??? ? ???? ???? ?? 2?????? ?2??? 2?????? ????-? e??? ?1? 2?????? e??? ??1-??? 2?????? ??1? ???? 3?? ? e? ????? ??? ??e????? e???? ? e???? ???a?? ???? ??? t? 2?????? ?y? ??- ? ? ?2? e ? ee? ??? ?y? ??- ? ?2? ? ?? e??? ?? ??? 3?? ????1? ?????2 e? e? e? e?
ps024502-1205preliminary interrupts zlr64400 rom mcu product specification 84 when more than one interrupt is pending, priorities are resolved by a programmable prior- ity encoder controlled by the interrupt priority register. an interrupt machine cycle acti- vates when an interrupt request is granted. as a result, all subsequent interrupts are disabled, and the program counter and status flags are saved. the cycle then branches to the program memory vector location reserved for that interrupt. all crimzon ? zlr64400 mcu interrupts are vectored through locations in the program memory. this memory location and the next byte contain the 16-bit address of the interrupt service routine for that particular interrupt request. to accommodate polled interrupt systems, interrupt inputs are masked, and the interrupt request register is polled to determine which of the inter- rupt requests require service. an interrupt resulting from an1 is mapped into irq2, and an interrupt from an2 is mapped into irq0. interrupts irq2 and irq0 can be rising, falling, or both edge trig- gered. these interrupts are programmable by the user. the software can poll to identify the state of the pin. table 40. interrupt types, sources, and vectors namesource vector location (program memory)comments irq0p32, uart rx0,1external (p32), rising, falling edge triggered irq1p33, uart tx, brg, smr event 2,3external (p33), falling edge triggered irq2p314,5external (p31), rising, falling edge triggered irq3timer 166,7internal irq4timer 88,9internal irq5low voltage detection10,11internal
ps024502-1205preliminary interrupts zlr64400 rom mcu product specification 85 programming bits for the interrupt edge select are located in the irq register (r250), bits d7 and bit 6. the configuration is indicated in table 41 . table 41. interrupt request register irq bitinterrupt edge 76irq2 (p31)irq0 (p32) 00ff 01fr 10rf 11r/fr/f note: f = falling edge; r = rising edge
ps024502-1205preliminary interrupt priority register zlr64400 rom mcu product specification 86 interrupt priority register the interrupt priority register ( table 42 ) defines which interrupts hold the highest prior- ity. interrupts are divided into three groups of two ? group a, group b, and group c. ipr bits 4, 3, and 0 determine which interrupt group has priority. for example, if interrupts irq5, irq1, and irq0 occur simultaneously when ipr[4:3, 0]=001b, the interrupts are serviced in the following order: irq1, irq0, irq5. ipr bits 5, 2, and 1 determine which interrupt within each group has higher priority. table 42. interrupt priority register (ipr) bit 7 6 5 4 3 2 1 0 field reservedgroup a priority group priority [2:1] group b priority group c priority group priority [0] reset xxxxxxxx r/w ? wwwww address bank independent: f9h; linear: 0f9h bit positionvaluedescription [7:6] ? reserved reads are undefined; writes must be 00b. [5] 0 1 group a priority (irq3, irq5) irq5 > irq3 irq3 > irq5 {[4:3], [0]} 000 001 010 011 100 101 110 111 group priority reserved c > a > b a > b > c a > c > b b > c > a c > b > a b > a > c reserved [2] 0 1 group b priority (irq0, irq2) irq2 > irq0 irq0 > irq2 [1] 0 1 group c priority (irq1, irq4) irq1 > irq4 irq4 > irq1
ps024502-1205preliminary interrupt request register zlr64400 rom mcu product specification 87 interrupt request register bits 7 and 6 of the interrupt request register are used to configure the edge detection of the interrupts for port 3, bit 1 and port 3, bit 2. the remaining bits, 5 through 0, indicate the status of the interrupt. when an interrupt is serviced, the hardware automatically clears the bit to 0. writing a 1 to any of these bits generates an interrupt if the appropriate bits in the interrupt mask register are enabled. writing a 0 to these bits clears the interrupts. see table 43 . table 43. interrupt request register (irq) bit 7 6 5 4 3 2 1 0 field interrupt edgeirq5irq4irq3irq2irq1irq0 reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: fah; linear: 0fah bit positionvaluedescription [7:6] 00 01 10 11 interrupt edge p31 p32 p31 p32 p31 p32 p31 p32 [5] read: 0 1 write: 0 1 irq5 (low voltage detection) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt. [4]read: 0 1 write: 0 1 irq4 (t8 counter) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt. [3]read: 0 1 write: 0 1 irq3 (t16 counter) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt.
ps024502-1205preliminary interrupt request register zlr64400 rom mcu product specification 88 the irq register is protected from change until an ei instruction is executed once. [2]read: 0 1 write: 0 1 irq2 (port 3 bit 1 input) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt. [1]read: 0 1 write: 0 1 irq1 (port 3 bit 3 input/smr event/uart t x /uart brg) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt. [0]read: 0 1 write: 0 1 irq0 (port 3 bit 2 input/uart r x ) interrupt did not occur. interrupt occurred. clear interrupt. set interrupt. bit positionvaluedescription note:
ps024502-1205preliminary interrupt mask register zlr64400 rom mcu product specification 89 interrupt mask register bits [5:0] are used to enable the interrupt. bit 7 is the status of the master interrupt. when reset, all interrupts are disabled. when writing a 1 to bit 7, the user must also execute the ei instruction to enable interrupts. see table 44 . table 44. interrupt mask register (imr) bit 7 6 5 4 3 2 1 0 field master interrupt enable reservedirq5 enable irq4 enable irq3 enable irq2 enable irq1 enable irq0 enable reset 0xxxxxxx r/w r/w ? r/wr/wr/wr/wr/wr/w address bank independent: fbh; linear: 0fbh bit positionvaluedescription [7] 0 1 master interrupt enable use only the di and ei instructions to alter this bit. always disable interrupts (di instruction) before writing this register. all interrupts are disabled. interrupts are enabled/disabled individually in bits [5:0]. [6]0reserved reads are undefined; writes must be 0. [5]0 1 disables irq5. enables irq5. [4]0 1 disables irq4. enables irq4. [3]0 1 disables irq3. enables irq3. [2]0 1 disables irq2. enables irq2. [1]0 1 disables irq1. enables irq1. [0]0 1 disables irq0. enables irq0.
ps024502-1205preliminary clock zlr64400 rom mcu product specification 90 clock the device ? s on-chip oscillator has a high-gain, parallel-resonant amplifier, for connection to a crystal, ceramic resonator, or any suitable external clock source (xtal1 = input, xtal2 = output). the crystal must be at cut, 1 mhz to 8 mhz maximum, with a series resistance (rs) less than or equal to 100 . the on-chip oscillator can be driven with a suitable external clock source. the crystal must be connected across xtal1 and xtal2 using the recommended capac- itors from each pin to ground. the typical capacitor value is 10 pf for 8 mhz. please also check with the crystal supplier for the optimum capacitance. zilog ir mcu supports crystal, resonator, and oscillator. most resonators have a fre- quency tolerance of less than 0.5%, which is enough for remote control application. res- onator has a very fast startup time, which is around few hundred microseconds. most crystals have a frequency tolerance of less than 50 ppm ( 0.005%). however, crystal needs longer startup time than the resonator. the large loading capacitance slows down the oscillation startup time. zilog suggests not to use more than 10pf loading capacitor for the crystal. if the stray capacitance of the pcb or the crystal is high, the loading capaci- tance c1 and c2 must be reduced further to ensure stable oscillation before the t por (power-on reset time is typically 5-6 ms. refer to the ac characteristics table). for stop mode recovery operation, bit 5 of smr register allows you to select the stop mode recovery delay, which is the t por . if stop mode recovery delay is not selected, the mcu executes instruction immediately after it wakes up from the stop mode. if resona- figure 32. oscillator configuration y? y ? ? ?? ? ? ? ? ?? ? ? ? y?-? ? y??y ? ??e?? o??| ????2 ? y? ??????? 3 2 ? ?a ? ?? ? ?? ? ? ? y?? ?3 ???-2 ? ??o??|
ps024502-1205preliminary crystal 1 oscillator pin (xtal1) zlr64400 rom mcu product specification 91 tor or crystal is used as a clock source then stop mode recovery delay needs to be selected (bit 5 of smr = 1). for both resonator and crystal oscillator, the oscillation ground must go directly to the ground pin of the microcontroller. the oscillation ground must use the shortest distance from the microcontroller ground pin and it must be isolated from other connections. crystal 1 oscillator pin (xtal1) the crystal 1 oscillator time-based input pin connects a parallel-resonant crystal or ceramic resonator to the on-chip oscillator input. additionally, an optional external single- phase clock can be connected to the on-chip oscillator input. crystal 2 oscillator pin (xtal2) the crystal 2 oscillator time-based output pin connects a parallel-resonant, crystal, or ceramic resonant to the on-chip oscillator output. internal clock signals (sclk and tclk) the cpu and internal peripherals are driven by the internal sclk signal during normal execution. during halt mode, the interrupt logic is driven by the internal tclk signal. these signals are produced by dividing the on-chip oscillator signal by a factor of two, and optionally by applying an additional divide-by-16 prescaler enabled in register bit smr[0] (described in table 47 on page 99 ). this is shown in figure 33 . selecting the divide-by-16 prescaler reduces device power draw during normal operation and halt mode. the prescaler is disabled by a power-on reset or stop-mode recovery. figure 33. sclk/tclk circuit ??e? ? e ?? ?? ?y y?? y??
ps024502-1205preliminary resets and power management zlr64400 rom mcu product specification 92 resets and power management the zlr64400 provides the following reduced-power modes, power monitoring, and reset features: ? power-on reset ? starts the oscillator and internal clock and initializes the system to its power-on reset defaults. ? voltage brown-out standby ? stops the oscillator and internal clock if a low-voltage condition occurs. initiates a power-on reset when power is restored. ? voltage detection ? optionally sets a flag if a low- or high-voltage condition occurs. the low-voltage detection flag can generate an interrupt request, if enabled. ? halt mode ? stops the internal clock to the cpu until an enabled interrupt request is received. ? stop mode ? stops the clock and oscillator, reducing the mcu supply current to a very low level until a power-on reset or stop-mode recovery occurs. ? stop mode recovery ? restarts the oscillator and internal clock and initializes most of the system to its power-on reset defaults. some register values are not reset by a stop- mode recovery. ? watch-dog timer ? optionally generates a power-on reset if the program fails to exe- cute the wdt instruction within a specified time interval. for supply current values under various conditions, see dc characteristics on page 125 . figure 34 on page 93 illustrates the power-on reset sources. table 45 lists control regis- ters for reset and power management features. some features are affected by registers described in other chapters. table 45. reset and power management registers address (hex) reset 12-bitbank8-bitregister descriptionmnemonicpage # d0cd0clow-voltage detection registerlvd 1111_1000b 95 f0af0astop-mode recovery register 4smr4 x x x 0 _ 0 0 0 0b 108 f0bf0bstop-mode recovery registersmr 0 0 1 0_ 0 0 00 b 99 f0cf0cstop-mode recovery register 1smr1 00h 102 f0df0dstop-mode recovery register 2smr2 x 0 x 0 _ 0 0 x xb 104 f0ef0estop-mode recovery register 3smr3 x0h 107 f0ff0fwatch-dog timer mode registerwdtmr x x x x _ 1 1 0 1b 109 note:
ps024502-1205preliminary power-on reset timer zlr64400 rom mcu product specification 93 power-on reset timer when power is initially applied to the device, a timer circuit clocked by a dedicated on- board rc-oscillator provides the power-on reset (por) timer function. the por timer circuit is a one-shot timer that keeps the internal reset signal asserted long enough for v dd and the oscillator circuit to stabilize before instruction execution begins. the reset timer is triggered by one of three conditions: ? initial power-on or recovery from a voltage brown-out/standby condition. ? stop-mode recovery (if register bit smr[5] = 1) ? watch-dog timer time-out. smr[5] can be cleared to 0 to bypass the por timer upon a stop-mode recovery. this should only be done when using an external clock that does not require a start-up delay. figure 34. resets and watch-dog timer ?y? ??-?? ?2????? ??? y???? ?e ???? y?? y??? e??? ? ? ?? ?????21 ??1? ?????2 2???2? ??? ???a? ?1? ?? t? ?3 ???? ???a?? ???? ???? e ? ?? 2- ???? ??? ? o ?y? ??? ?e?? y?2??? y??2 ?y??? ?2? y??? ?2??? ??? ?e?? ?2? ? y? ??-?? ?3??-? ??-???a?? ?2 ? ????1? 2?? ???2-??2 yy 2???2? ?y ?-???? ???
ps024502-1205preliminary reset/stop-mode recovery status zlr64400 rom mcu product specification 94 reset/stop-mode recovery status read-only bit smr[7]=0 if the previous reset was initiated by a power-on reset (including brown-out or wdt resets). smr[7]=1 if the previous reset was initiated by a stop-mode recovery. a power-on, brown-out, or wdt reset restores all registers to their power-on reset defaults. a stop-mode recovery restores most registers to their power-on reset defaults. register bits not reset by a stop-mode recovery are highlighted in grey in the register tables. register bit smr[7] is set to 1 instead of reset by a stop-mode recovery. voltage brown-out/standby an on-chip voltage comparator checks that the v dd is at the required level for correct operation of the device. reset is globally driven when v dd falls below v bo . a small drop in v dd causes the xtal1 and xtal2 circuitry to stop the crystal or resonator clock. if the v dd is allowed to stay above v ram , the ram content is preserved. when the power level is returned to above v bo , the device performs a power-on reset and functions nor- mally. voltage detection the voltage detection register (lvd, register ey? at the expanded register bank e? ) offers an option of monitoring the v cc voltage. the voltage detection is enabled when bit 0 of lvd register is set. after voltage detection is enabled, the v cc level is monitored in real time. the hvd flag (bit 2 of the lvd register) is set only if v cc is higher than v hvd. the lvd flag (bit 1 of the lvd register) is set only if v cc is lower than the v lvd . when voltage detection is enabled, the lvd flag also triggers irq5. the irq bit 5 latches the low voltage condition until it is cleared by instructions or reset. the irq5 interrupt is served if it is enabled in the imr register. otherwise, bit 5 of irq register is latched as a flag only. do not modify register p01m while checking a low-voltage condition. switching noise coming from port 0 can trigger the lvd flag. voltage detection does not work in stop mode. it must be disabled during stop mode in order to reduce current. this register is described in table 46 on page 95 . note:
ps024502-1205preliminary halt mode zlr64400 rom mcu product specification 95 halt mode this instruction turns off the internal cpu clock, but not the xtal oscillation. the counter/timers, uart, and interrupts irq0, irq1, irq2, irq3, irq4, and irq5 remain active. the devices are recovered by interrupts, either externally or internally generated. an interrupt request must be executed (enabled) to exit halt mode. after the interrupt service routine, the program continues from the instruction after halt mode. to enter halt mode, first flush the instruction pipeline to avoid suspending execution in mid-instruction. execute a nop (op code = ? ) immediately before the appropriate sleep instruction, as follows: ?e? ???? ??? ???2? ???? ?2??? ??? 3?? power consumption during halt mode can be reduced by first setting smr[0]=1 to enable the divide-by-16 clock prescaler. table 46. low-voltage detection register (lvd) bit 7 6 5 4 3 2 1 0 field reserved high battery detect low battery detect voltage detect enable reset 11111000 r/w rrrrrrrr/w address bank d: 0ch; linear: d0ch bit positionr/wvaluedescription [7:3] ?? reserved ? reads 11111b. writes have no effect. [2] r0 1 hvd clear. high voltage detected. v cc >v hvd [1] r0 1 lvd clear. low voltage detected. v cc ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 96 stop mode this instruction turns off the internal clock and external crystal oscillation, reducing the mcu supply current to a very low level. for stop mode current specifications, see dc characteristics on page 125 . to enter stop mode, first flush the instruction pipeline to avoid suspending execution in mid-instruction. execute a nop (op code = ? ) immediately before the appropriate sleep instruction, as follows: ?e? ???? ??? ???2? ?e? ?2??? ?e 3?? stop mode is terminated only by a reset, such as wdt time-out, por, or one of the stop- mode recovery (smr) events described in the following sections. this condition causes the processor to restart the application program at address eeey? . unlike a normal por or wdt reset, a stop-mode recovery reset does not reset the con- tents of some registers and bits. register bits not reset by a stop-mode recovery are high- lighted in grey in the register tables. register bit smr[7] is set to 1 by a stop-mode recovery. fast stop mode recovery smr[5] can be cleared to 0 before entering stop mode to bypass the default t por reset timer upon stop-mode recovery. see power-on reset timer on page 93 . if smr[5]=0, the stop-mode recovery source must be kept active for at least 10 input clock periods (tpc). smr[5] must be set to 1 if using a crystal or resonator clock source. the t por delay allows the clock source to stabilize before executing instructions. stop mode recovery interrupt software can set register bit smr4[4] = 1 to enable routing of stop-mode recovery events to irq1 and to port 3, pin 3. in this configuration, if an irq1 interrupt occurs, register bit p3[3] = 0 indicates that a stop-mode recovery event is occurring. note:
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 97 stop mode recovery event sources any port 2 or 3 input pin can be configured to generate a sop-mode recovery event, either individually or in a variety of logical combinations. the partname provides the following registers for stop-mode recovery source configuration and status: ? smr register ? selects one port 3, pin 1 ? 3 pin state or one of three port 2 pin logical combinations to generate an event when a defined 0 or 1 level occurs. ? smr1 register ? configure one or more port 2 input pins (0 ? 7)to latch the latest read or write value and generate an event when the pin state changes. ? smr2 register ? selects one of seven port 2 and 3 pin logical combinations to gener- ate an event when a defined 0 or 1 level occurs. ? smr3 register ? configure one or more port 3 input pins (0 ? 3) to latch the latest read or write value and generate an event when the pin state changes. ? smr4 register ? enables routing of smr events to irq1. indicates whether port data has been latched for smr1 or smr3 event monitoring, and whether the latch was on a port read or write. a stop-mode recovery event occurs if any of the sources defined in the smr, smr1, smr2, and smr3 registers is active. smr register events the smr register function is similar to the standard stop-mode recovery feature used in previous z8 ? cpu-compatible parts. register bits smr[4:2] are set to select one of six event modes, as shown in figure 35 on page 98 . the output of the corresponding logic is compared to the state of smr[6]; when they are the same, a stop-mode recovery event is generated. if smr[4:2]=000, no event source is selected by smr. the state smr[4:2]=001 is reserved and selects no event in this device. the logic configured by the smr register ignores any port pins that are configured as an output, or that are selected as source pins in registers smr1 or smr3. the smr register is summarized in table 47 on page 99 .
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 98 figure 35. smr register-controlled event sources e? e? e e??? ?? e? e?e e ? e? e?e e? ????? ? eee ????? ? e?e ????? ? e?? ????? ? ?ee ????? ? ?e? ??? ???? ? ??e ???? ? ??? ??? ? ?? ?? ? ??? ?2? y????? ????a? ?? ??? ?2? ee?? yy ?? ? ??1-??? 1? 12??- ?2 ?2 ?2o1???? ?- ?2 ???? 2 ??? e? ? e ??1-???- ? ?- ? -???? 2 ??? ?? ? ? ??1-???-
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 99 [ table 47. stop-mode recovery register (smr) bit 7 6 5 4 3 2 1 0 field stop flag stop-mode recovery level stop delay stop-mode recovery source reserved sclk/tclk divide-by-16 reset0 0 1 0 0 000 r/w rwwwwwww address bank f: 0bh; linear: f0bh bit positionvaluedescription [7] 0 1 stop flag ? indicates whether last startup was power-on reset or stop-mode recovery. a write to this bit has no effect. power-on reset. stop-mode recovery. [6] 0 1 stop-mode recovery level ? selects whether an smr[4:2]-selected smr is initiated by a low or high level at the xor-gate input (see figure 35 on page 98 ). low. high. [5] 0 1 stop delay ? controls the reset delay after recovery. must be 1 if using a crystal or resonator clock source. off. on. [4:2] 000 001 010 011 100 101 110 111 stop-mode recovery source ? specifies a stop mode recovery wake-up source at the xor gate input (see figure 35 on page 98 ). this value is not changed by a stop-mode recovery. the following equations ignore any port pin configured as output or selected in smr1 or smr3. no smr register source selected. reserved. p31. p32. p33. p27. port 2 nor 0 ? 3. port 2 nor 0 ? 7. [1] ? reserved ? reads are undefined; must write 0. [0] 0 1 sclk/tclk divide-by-16 select ? controls a divide-by-16 prescaler of the internal sclk/tclk signal (see internal clock signals (sclk and tclk) on page 91 ). a power-on reset or stop-mode recovery clears this bit to 0. off. on.
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 100 smr1 register events the smr1 register can be used to configure one or more port 2 pins to be to be compared to a written or sampled reference value and generate a stop-mode recovery event when the pin state differs from the reference value. to configure a port 2 pin as an smr1 event source, make sure it is configured as an input in the p2m register, then set the corresponding smr1 register bit. by default, a stop-mode recovery event occurs when the pin ? s state is zero. after a port 2 pin is configured as an smr1 source, any subsequent read from or write to the p2 register latches the read or written value for reference. a stop-mode recovery event occurs when the pin ? s state differs from the last reference value latched. the smr1 source logic is illustrated in figure 36 on page 101 . the program can read register bits smr4[1:0] to determine whether the port 2 pins trigger a stop-mode recovery on a change from the last read value (smr4[1:0]=01), or on a change from the last written value (smr4[1:0]=10). software can clear smr4[1:0] to 00 to restore the default behavior (configured pins trigger when their state is 0). the smr1 register is summarized in table 48 on page 102 . after the following example code is executed, a 1 on p2 0 will wake the part from stop mode. after the following example code is executed when the value of p2 is 00h, a 1 on p20 will wake the part from stop mode: ? e?? y???? e?? ? ? 2??- ? ??? y?e?????? e?e o? ?? ? e?? y?ee???? ee? ? e?? ?? - ??? e?e ??o???2?? ?a??? - e? ?2? ? ? 2 e?e ???- ??? ??? ?e ?e ? e?? y???? ??- ? 2??- ? ??? y?e?????? e?e o? ?? ? ?? e??o ? e - ???? o?3 e?? ?? ??? e?e ??o???2?? ?a??? - e? - ? ? 2 e?e ???- ??? ??? ?e ?e
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 101 figure 36. smr1 register-controlled event sources p3m[1] or p33 0 1 port 2, pin n individual port 2 pin smr logic, n = 0-7 bit p2m[ n ] bit smr1[ n ] bit p2[ n ] smr4[4] smr3 smr2 to reset and wdt circuitry (active low) to smr1 smr smr1 dq p20 logic p21 logic p22 logic p23 logic p24 logic p25 logic p26 logic p27 logic port 2 read/write irq1 register p3, bit 3
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 102 this register is not reset after a stop-mode recovery. table 48. stop-mode recovery register 1 (smr1) bit 7 6 5 4 3 2 1 0 field p27 stop select p26 stop select p25 stop select p24 stop select p23 stop select p22 stop select p21 stop select p20 stop select reset 0 0 0 0 0 0 0 0 r/w wwwwwwww address bank f: 0ch; linear: f0ch bit positionvaluedescription [7] 0 1 p27 not selected. p27 selected as an smr source. [6] 0 1 p26 not selected. p26 selected as an smr source. [5]0 1 p25 not selected. p25 selected as an smr source. [4]0 1 p24 not selected. p24 selected as an smr source. [3]0 1 p23 not selected. p23 selected as an smr source. [2]0 1 p22 not selected. p22 selected as an smr source. [1]0 1 p21 not selected. p21 selected as an smr source. [0]0 1 p20 not selected. p20 selected as an smr source. note:
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 103 smr2 register events the smr2 register function is similar to the standard stop-mode recovery feature used in previous z8 ? cpu-compatible parts. register bits smr2[4:2] are set to select one of seven event modes, as shown in figure 37 . the output of the corresponding logic is com- pared to the state of smr2[6]; when they are the same, a stop-mode recovery event is gen- erated. if smr2[4:2]=000, no event source is selected by smr2. the logic configured by the smr2 register ignores any port pins that are configured as an output, or that are selected as source pins in registers smr1 or smr3. the smr2 register is summarized in table 49 on page 104 . figure 37. smr2 register-controlled event sources eee e? ?????? ? eee ?????? ? e?e ?????? ? e?? ?????? ? ?ee ?????? ? ?e? ?????? ? ??e ?????? ? ??? ?????? ? ee? e?e e? e? e?e e? e? e e? e e? e? e eee ee e? e? e ee e?e e? e? e e?? e?? ???? yy e??? ?? e ? ??? e ??? ?2? y????? ????a? ?? ??? ?2? ee?? ? ?? ?? ? ?? ?? ??1-??? 1? 12??- ?2 ?2 ?2o1???? ?- ?2 ???? 2 ??? e? ? e ??1-???- ? ?- ? -???? 2 ??? ?? ? ? ??1-???-
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 104 this register is not reset after a stop-mode recovery. table 49. stop-mode recovery register 2 (smr2) bit 7 6 5 4 3 2 1 0 field reservedstop-mode recovery level 2 reservedstop-mode recovery source reserved reset x 0 x 0 0 0 x x r/w ? w ? www ? address bank f: 0dh; linear: f0dh bit positionvaluedescription [7] ? reserved ? read is undefined; write must be 0. [6] 0 1 stop-mode recovery level 2 selects whether an smr2[4:2]-selected smr is initiated by a low or high level at the xor-gate input (see figure 37 on page 103 ). low. high. [5] ? reserved ? read is undefined; write must be 0. [4:2] 000 001 010 011 100 101 110 111 stop-mode recovery source specifies a stop mode recovery wake-up source at the xor gate input (see figure 37 on page 103 ). additional sources can be selected by smr, smr1, and smr3 registers. if more than one source is selected, any selected source event causes a stop mode recovery. the following equations ignore any port pin that is selected in register smr1 or configured as an output. no smr2 register source selected. nand of p23:p20. nand of p27:p20. nor of p33:p31. nand of p33:p31. nor of p33:p31, p00, p07. nand of p33:p31, p00, p07. nand of p33:p31, p22:p20. [1:0] ? reserved ? read is undefined; write must be 00b. note:
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 105 smr3 register events the smr3 register can be used to configure one or more of port 3, pins 0 ? 3 to be com- pared to a written or sampled reference value and generate a stop-mode recovery event when the pin state differs from the reference value. to configure a port 3 input pin as an smr3 event source set the corresponding smr3 reg- ister bit. by default, a stop-mode recovery event occurs when the pin ? s state is zero. after a port 3 pin is configured as an smr3 source, any subsequent read from or write to the p2 register latches the read or written value for reference. a stop-mode recovery event occurs when the pin ? s state differs from the last reference value latched. the smr3 source logic is illustrated in figure 38 on page 106 . the program can read register bits smr4[3:2] to determine whether the port 3 pins trigger a stop-mode recovery on a change from the last read value (smr4[3:2]=01), or on a change from the last written value (smr4[3:2]=10). software can clear smr4[3:2] to 00 to restore the default behavior (configured pins trigger when their state is 0). the smr3 register is summarized in table 47 on page 99 . after the following example code is executed, a 1 on p30 will wake the part from stop mode. after the following example code is executed when the value of p3 is 00h, a 1 on p30 will wake the part from stop mode. ? ?? y?e?????? ee o?3 ? ? e? y?ee???? ee? ? e?? ? - ??? ee ??o???2?? ?a??? - e? ?2? ? ? 2 ee ???- ??? ??? ?e ?e ? ?? y?e?????? ee o? ? ? ?? e?o ? e - ???? o?3 e?? ? ??? ee ??o???2?? ?a??? - e? - ? ? 2 ee ???- ??? ??? ?e ?e
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 106 figure 38. smr3 register-controlled event sources e??? ?? e e ? e?? ? e2 n e?? ???????? 2?a??? e?? e2 ? ?1?? n ? e t? ?? n ? t? e? n ? ??? ? ?? ??? ?2? y????? ????a? ?? ??? ?2? ee?? ? ? ?? ? ee ?1? e? ?1? e? ?1? e ?1?
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 107 this register is not reset after a stop-mode recovery. table 50. stop-mode recovery register 3 (smr3) bit 7 6 5 4 3 2 1 0 field ? p33 smr select p32 smr select p31 smr select p30 smr select reset x x x x 0 0 0 0 r/w ???? wwww address bank f: 0eh; linear: f0eh bit positionvaluedescription [7:4] ? reserved ? reads undefined; writes have no effect. [3] 0 1 p33 not selected. p33 smr source selected. [2] 0 1 p32 not selected. p32 smr source selected. [1] 0 1 p31 not selected. p31 smr source selected. [0]0 1 p30 not selected. p30 smr source selected. note:
ps024502-1205preliminary stop mode zlr64400 rom mcu product specification 108 stop-mode recovery register 4 the stop-mode recovery register 4 (smr4) register enables the smr interrupt source and indicates the reference value status for registers smr1 and smr3. this register is not reset after a stop-mode recovery. table 51. stop-mode recovery register 4 (smr4) bit 7 6 5 4 3 2 1 0 field reservedsmr irq enableport 3 smr statusport 2 smr status reset x x x 0 0 0 0 0 r/w ??? r/wr/wr/wr/wr/w address bank f: 0ah; linear: f0ah bit positionvaluedescription [7:5] ? reserved ? reads are undefined; must write 000b. [4] 0 1 smr irq enable if p3m[1]=0, smr events do not generate an interrupt. smr events generate an interrupt on irq1. [3:2] 00 01 10 11 port 3 smr status no read or write of the p3 register occurs. p3 read occurs; used as smr3 reference. p3 write occurs; used as smr3 reference. reserved. [1:0] 00 01 10 11 port 2 smr status no read or write of the p2 register occurs. p2 read occurs; use p2 read as smr1 reference. p2 write occurs; use p2 write as smr1 reference. reserved. note:
ps024502-1205preliminary watch-dog timer zlr64400 rom mcu product specification 109 watch-dog timer the watch-dog timer (wdt) is a retriggerable one-shot timer that resets the z8 lxm cpu if it reaches its terminal count. the wdt must initially be enabled by executing the wdt instruction. on subsequent executions of the wdt instruction, the wdt is refreshed. the wdt circuit is driven by an on-board rc-oscillator. the wdt instruction affects the zero (z), sign (s), and overflow (v) flags. the por clock source is the internal rc-oscillator. bits 0 and 1 of the wdt register con- trol a tap circuit that determines the minimum time-out period. bit 2 determines whether the wdt is active during halt, and bit 3 determines wdt activity during stop mode. bits 4 through 7 are reserved (see table 52 ). this register is accessible only during the first 60 processor cycles (120 xtal clocks) from the execution of the first instruction after power-on reset, watch-dog timer reset, or a stop-mode recovery (see stop mode on page 96 ). after this point, the register cannot be modified by any means (intentional or otherwise). the wdtmr register cannot be read. the register is located in bank f of the expanded register group at address location e? . it is organized as shown in table 52 . this register is not reset after a stop-mode recovery. table 52. watch-dog timer mode register (wdtmr) bit 7 6 5 4 3 2 1 0 field ? wdt during stop mode wdt during halt mode time-out select reset x x x x 1 1 0 1 r/w xxxxwwww address bank f: 0fh; linear: f0fh bit positionvaluedescription [7:4] ? reserved ? reads are undefined; must write 0000. [3] 0 1 wdt during stop mode ? determines whether or not the wdt is active during stop mode. off. wdt active during stop mode. [2] 0 1 wdt during halt mode ? determines whether or not the wdt is active during halt mode. see figure 34 . off. wdt active during halt mode. note:
ps024502-1205preliminary watch-dog timer zlr64400 rom mcu product specification 110 [1:0] 00 01 10 11 time-out select ? selects the wdt time period. 5 ms minimum. 10 ms minimum. 20 ms minimum. 80 ms minimum. bit positionvaluedescription
ps024502-1205preliminary z8 lxm cpu programming summary zlr64400 rom mcu product specification 111 z8 lxm cpu programming summary the following pages provide a summary of information useful for programming the z8 lxm cpu included in this device. for details about the cpu and its instruction set, see the z8 lxm cpu core user manual (um0183) . addressing notation table 53 summarizes z8 lxm cpu addressing modes and symbolic notation. the text variable n represents a decimal number; aa represents a hexadecimal address; and label represents a label defined elsewhere in the assembly source. in reference notation only , lowercase is used to distinguish 4-bit addressed working regis- ters (r1, r2) from 8-bit addressed registers (r1, r2). the numerals 1 and 2, respectively, indicate whether the register is used for destination or source addressing. . table 53. symbolic notation for operands symbol assembly operanddescription cc ? condition code cc represents a condition code mnemonic. see condition codes on page 115 . im y n immediate data im represents an immediate data value, prefixed by # in assembly language. the immediate value follows the instruction opcode in program memory. n = 0 to 255. r1 r2 r n working register r1 or r2 represents the name, r n , of a working register, where n = 0, 1, 2,..., 15. the equivalent 12-bit address is {rp[3:0], rp[7:4], n }. rr1 rr2 rr n working register pair rr1 or rr2 represents the name, r n , of a working register pair, where n = 0, 2, 4,..., 14. the equivalent 12-bit address is {rp[3:0], rp[7:4], n }. r1 r2 % aa register r1 or r2 represents an 8-bit register address. for addresses 00h ? dfh or f0h ? ffh, the equivalent 12-bit address is {rp[3:0], % aa }. for addresses e0h ? efh (escaped mode), the equivalent 12-bit address is {rp[3:0], rp[7:4], % aa [3:0]}. rr1 rr2 % aa register pair (8-bit address) rr1 or rr2 represents the 8-bit address of a register pair. for addresses 00h ? dfh or f0h ? ffh, the equivalent 12-bit address is {rp[3:0], % aa }. for addresses e0h ? efh (escaped mode), the equivalent 12-bit address is {rp[3:0], rp[7:4], % aa [3:0]}.
ps024502-1205preliminary addressing notation zlr64400 rom mcu product specification 112 irr1 irr2 @r n indirect working register ir1 or ir2 represents the name a working register, r n, where n = 0, 1, 2,..., 15. @ indicates indirect working register addressing using an 8-bit effective address contained in the specified working register. the accessed register ? s equivalent 12-bit address is {rp[3:0], 8-bit effective address }. irr1 irr2 @rr n indirect working register pair irr1 or irr2 represents the name a working register pair, rr n, where n = 0, 2, 4,..., 14. @ indicates indirect working register addressing using an effective address in the specified working register pair. depending on the instruction, the effective address is in the register file (12-bit address) or program/constant memory (16-bit address). ir1 ir2 @% aa indirect register ir1 or ir2 represents the 8-bit address of a register. @ indicates indirect register addressing using an 8-bit effective address contained in the specified register. the accessed register ? s equivalent 12-bit address is {rp[3:0], 8-bit effective address }. irr1@% aa indirect register pair irr1 represents the 8-bit address of a register. @ indicates indirect register addressing with a 16-bit effective address (in program memory) contained in the specified register pair. x(r1) x(r2) % aa (r n ) indexed (x) addressing x represents the 8-bit base address to which the offset is added. r1 or r2 represents the name, r n , of a working register containing the 8-bit signed offset. the 8-bit effective address is the sum of x and the contents of working register r n . the accessed register ? s equivalent 12-bit address is {rp[3:0], 8-bit effective address }. da label direct address (jp, call) in a jp or call operand, da is a 16-bit program memory address in the range of eeee? to ? . da replaces the contents of the program counter to cause execution to continue at a new location in program memory. in assembly source, the address is typically represented as a label. ra label relative address (jr, djnz) ra is a signed 8-bit program memory offset in the range +127 to ? 128, relative to the address of the next instruction in program memory. in a jr or djnz operation, ra is added to the program counter to cause execution to continue at a new location in program memory. in assembly source, the jump address is typically represented as an absolute label, and the assembler calculates ra. table 53. symbolic notation for operands (continued) symbol assembly operanddescription
ps024502-1205preliminary addressing notation zlr64400 rom mcu product specification 113 table 54 contains additional symbols that are used throughout the instruction set summary. table 54. additional symbols symboldefinition dstdestination operand srcsource operand @indirect address prefix ccarry flag spstack pointer value pcprogram counter flagsflags register rpregister pointer #immediate operand prefix bbinary number suffix %hexadecimal number prefix hhexadecimal number suffix assignment of a value. for example, dst dst + src indicates the result is stored in the destination. exchange of two values ~ one ? s complement unary operator
ps024502-1205preliminary flags register zlr64400 rom mcu product specification 114 flags register the flags register informs the user of the current status of the z8 cpu. it contains six bits of status information. see table 55 . table 55. flags register (flags) bit 7 6 5 4 3 2 1 0 field czsodhf1f2 reset xxxxxxxx r/w r/wr/wr/wr/wr/wr/wr/wr/w address bank independent: fch; linear 0fch bit positionvaluedescription [7] 0 1 carry flag (c) set when the result of an arithmetic operation generates a carry out of or a borrow into the high-order bit (bit 7) of the result. also used in rotate and shift instructions. flag clear flag set [6] 0 1 zero flag (z) set when the result of an arithmetic operation is 0. flag clear flag set [5] 0 1 sign flag (s) stores the value of the most significant bit following an arithmetic, logical, rotate, or shift instruction. flag clear flag set [4] 0 1 overflow flag (o) set when the result of an arithmetic operation is greater than 127. flag clear flag set [3] 0 1 decimal adjust flag (d) used for binary-coded decimal (bcd) arithmetic. flag clear flag set [2] 0 1 half carry flag (h) set when a carry out of or borrow into bit 3 of an arithmetic operation occurs. flag clear flag set
ps024502-1205preliminary condition codes zlr64400 rom mcu product specification 115 condition codes the c, z, s, and v flags control the operation of the conditional jump (jp cc and jr cc) instructions. sixteen frequently useful functions of the flag settings are encoded in a 4-bit field called the condition code (cc). table 56 summarizes the condition codes. some binary condition codes can be created using more than one assembly code mnemonic. the result of the flag test operation determines if the conditional jump executes. [1] 0 1 user flag 1 (f1) available to software for use as a general-purpose bit. bit clear bit set [0] 0 1 user flag 2 (f2) available to software for use as a general-purpose bit. bit clear bit set table 56. condition codes binaryhex assembly mnemonicdefinitionflag test operation 00000falways false ? 00011ltless than(s xor v) = 1 00102leless than or equal(z or (s xor v)) = 1 00113uleunsigned less than or equal(c or z) = 1 01004ovoverflowv = 1 01015mlminuss = 1 01106zzeroz = 1 01106eqequalz = 1 01117ccarryc = 1 01117ultunsigned less thanc = 1 10008t (or blank)always true ? 10019gegreater than or equal(s xor v) = 0 1010agtgreater than(z or (s xor v)) = 0 1011bugtunsigned greater than(c = 0 and z = 0) bit positionvaluedescription
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 116 z8 lxm cpu instruction summary table 57 summarizes the z8 lxm cpu instructions. the table identifies the addressing modes employed by the instruction, the effect upon the flags register, the number of cpu clock cycles required for the instruction fetch, and the number of cpu clock cycles required for the instruction execution. 1100cnovno overflowv = 0 1101dplpluss = 0 1110enznon-zeroz = 0 1110enenot equalz = 0 1111fncno carryc = 0 1111fugeunsigned greater than or equal c = 0 table 57. z8 lxm cpu instruction summary assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute adc dst, srcdst dst + src + crr12****0*65 rir1365 rr14105 rir15105 rim16105 irim17105 flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set table 56. condition codes (continued) binaryhex assembly mnemonicdefinitionflag test operation
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 117 add dst, srcdst dst + srcrr02****0*65 rir0365 rr04105 rir05105 rim06105 irim07105 and dst, srcdst dst and srcrr52 ? **0 ?? 65 rir5365 rr54105 rir55105 rim56105 irim57105 call dstsp sp -2 @sp pc pc dst irrd4 ?????? 200 dad6200 ccfc ~cef* ????? 65 clr dstdst 00hrb0 ?????? 65 irb165 com dstdst ~dstr60 ? **0 ?? 65 ir6165 cp dst, srcdst ? src ? crra2**** ?? 65 rira365 rra4105 rira5105 rima6105 irima7105 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 118 da dstdst da(dst)r40***x ?? 85 ir4185 dec dstdst dst ? 1r00 ? *** ?? 65 ir0165 decw dstdst dst ? 1rr80 ? *** ?? 105 ir81105 didisable interrupts irqctl[7] 0 8f ?????? 61 djnz dst, radst dst ? 1 if dst 0 pc pc + x r0a ? fa ?????? nz/z 12/10 5 eienable interrupts irqctl[7] 1 9f ?????? 61 halthalt mode7f ?????? 70 inc dstdst dst + 1r20 ? *** ?? 65 ir2165 r0e ? fe65 incw dstdst dst + 1rra0 ? *** ?? 105 ira1105 iretflags @sp sp sp + 1 pc @sp sp sp + 2 irqctl[7] 1 bf******160 jp dstpc dstda8d ?????? 12 0 irr308 0 jp cc, dstif cc is true pc dst da0d ? fd ?????? t/f 12/10 0 jr dstpc pc + xra8b ?????? 12 0 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 119 jr cc, dstif cc is true pc pc + x ra0b ? fb ?????? t/f 12/10 0 ld dst, srcdst srcrim0c ? fc ?????? 65 rr08 ? f865 rr09 ? f965 rx(r)c7105 x(r) rd7105 rire365 rre4105 rire5105 rime6105 irime7105 irrf365 irrf5105 ldc dst, srcdst srcrirrc2 ?????? 120 irrrd2120 ldci dst, srcdst src r r + 1 rr rr + 1 irirrc3 ?????? 180 irrird3180 ldx dst, srcdst srcrirr82 ?????? 120 irrr92120 ldxi dst, srcdst src r r + 1 rr rr + 1 irirr83 ?????? 180 irrir93180 nopno operationff ?????? 60 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 120 or dst, srcdst dst or srcrr42 ? **0 ?? 65 rir4365 rr44105 rir45105 rim46105 irim47105 pop dstdst @sp sp sp + 1 r50 ?????? 105 ir51105 push srcsp sp ? 1 @sp src r70 ?????? 101 ir71121 rcfc 0cf0 ????? 65 retpc @sp sp sp + 2 af ?????? 140 rl dstr90**** ?? 65 ir9165 rlc dstr10**** ?? 65 ir1165 rr dstre0**** ?? 65 ire165 rrc dstrc0**** ?? 65 irc165 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 121 sbc dst, srcdst dst ? src ? crr32****1*65 rir3365 rr34105 rir35105 rim36105 irim37105 scfc 1df1 ????? 65 sra dstrd0***0 ?? 65 ird165 srp srcrp srcim31 ?????? 61 stopstop mode6f ?????? 60 sub dst, srcdst dst ? srcrr22****1*65 rir2365 rr24105 rir25105 rim26105 irim27105 swap dstdst[7:4] dst[3:0]rf0 ? **x ?? 85 irf185 tcm dst, src(not dst) and srcrr62 ? **0 ?? 65 rir6365 rr64105 rir65105 rim66105 irim67105 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set d7 d6 d5 d4 d3 d2 d1 d0 dst c
ps024502-1205preliminary z8 lxm cpu instruction summary zlr64400 rom mcu product specification 122 tm dst, srcdst and srcrr72 ? **0 ?? 65 rir7365 rr74105 rir75105 rim76105 irim77105 wdt5f ?????? 60 xor dst, srcdst dst xor srcrrb2 ? **0 ?? 65 rirb365 rrb4105 rirb5105 rimb6105 irimb7105 table 57. z8 lxm cpu instruction summary (continued) assembly mnemonicsymbolic operation address mode op- code(s) (hex) flagscycles dstsrcczsvdhfetchexecute flag states: * = state depends on result; ? = no change; x = undefined; 0 = cleared; 1 = set
ps024502-1205preliminary electrical characteristics zlr64400 rom mcu product specification 123 electrical characteristics absolute maximum ratings stresses greater than those listed in table 58 may cause permanent damage to the device. these ratings are stress ratings only. functional operation of the device at any condition outside those indicated in the operational sections of these specifications is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. for improved reliability, unused inputs should be tied to one of the supply volt- ages (v dd or v ss ). table 58. absolute maximum ratings parametermin.max.units ambient temperature under bias0+70c storage temperature ? 65+150c voltage on any pin with respect to v ss * ? 0.3+4.0v voltage on v dd pin with respect to v ss ? 0.3+3.6v maximum current on input and/or inactive output pin ? 5+5 a maximum output current from active output pin ? 25+25ma maximum current into v dd or out of v ss 75ma *note: this voltage applies to all pins except v dd , p32, and p33.
ps024502-1205preliminary standard test conditions zlr64400 rom mcu product specification 124 standard test conditions the characteristics listed in this product specification apply for standard test conditions as noted. all voltages are referenced to ground. positive current flows into the referenced pin (see figure 39 ). capacitance table 59 lists the capacitances. figure 39. test load diagram table 59. capacitance parametermaximum input capacitance12 pf output capacitance12 pf i/o capacitance12 pf note: t a = 25 c, v cc = gnd = 0 v, f = 1.0 mhz, unmeasured pins returned to gnd. from output under test 150 pf i
ps024502-1205preliminary dc characteristics zlr64400 rom mcu product specification 125 dc characteristics table 60 describes the direct current characteristics of the zlr64400 rom mcu. table 60.dc characteristics symbolparameterv cc t a = 0 o c to +70 o c unitsconditions mintypmax v cc supply voltage 1 2.03.6vsee note 5 v ch clock input high voltage 2.0 ? 3.60.8 v cc v cc +0.3vdriven by external clock generator v cl clock input low voltage 2.0 ? 3.6v ss ? 0.30.4vdriven by external clock generator v ih input high voltage2.0 ? 3.60.7 v cc v cc +0.3v v il input low voltage2.0 ? 3.6v ss ? 0.30.2 v cc v v oh1 output high voltage2.0 ? 3.6v cc ? 0.4vi oh = ? 0.5 ma v oh2 output high voltage (p36, p37, p00, p01) 2.0 ? 3.6v cc ? 0.8vi oh = ? 7 ma v ol1 output low voltage2.0 ? 3.60.4vi ol = 4.0 ma v ol2 output low voltage (p00, p01, p36, p37) 2.0 ? 3.60.8vi ol = 10 ma v offset comparator input offset voltage 2.0 ? 3.625mv v ref comparator reference voltage 2.0 ? 3.60v cc ? 1.75 v i il input leakage2.0 ? 3.6 ? 11 av in = 0 v, v cc; pull- ups disabled. i il1 input leakage ir amp (p31) 2.0 ? 3.6 ? 2.5 ? 10 av in = 0 v, ir amp enabled. notes: 1.zilog recommends adding a filter capacitor (minimum 0.1 f), physically close to v dd and v ss if operating voltage fluctuations are anticipated, such as those resulting from driving an infrared led. 2.all outputs unloaded, inputs at rail. 3.cl1 = cl2 = 100 pf. 4.oscillator stopped. 5.oscillator stops when v cc falls below v bo limit.
ps024502-1205preliminary dc characteristics zlr64400 rom mcu product specification 126 i ol output leakage2.0 ? 3.6 ? 11mav in = 0 v, v cc i cc supply current 2,3 2.013maat 8.0 mhz 3.6510maat 8.0 mhz i cc1 standby current 2,3 (halt mode) 2.00.51.6mav in = 0 v, v cc at 8.0 mhz 3.60.82.0ma i cc2 standby current 4 (stop mode) 2.01.68 av in = 0 v, v cc wdt is not running 3.61.810 a 2.0520 av in = 0 v, v cc wdt is running 3.6830 a i lv standby current 5 (low voltage) 1.26 ameasured at 1.3 v v bo v cc low voltage protection 1.82.0v v lvd v cc low voltage detection 2.4v v hvd v cc high voltage detection 2.7v t oniramp wake-up time from disabled mode 2.0 ? 3.620 s i det ir amp current for signal detection 2.0 ? 3.610100 air amp enabled table 60.dc characteristics (continued) symbolparameterv cc t a = 0 o c to +70 o c unitsconditions mintypmax notes: 1.zilog recommends adding a filter capacitor (minimum 0.1 f), physically close to v dd and v ss if operating voltage fluctuations are anticipated, such as those resulting from driving an infrared led. 2.all outputs unloaded, inputs at rail. 3.cl1 = cl2 = 100 pf. 4.oscillator stopped. 5.oscillator stops when v cc falls below v bo limit.
ps024502-1205preliminary ac characteristics zlr64400 rom mcu product specification 127 ac characteristics figure 40 and table 61 describe the alternating current (ac) characteristics. figure 40. ac timing diagram clock 1 3 4 8 2 2 3 t in irq n 6 5 7 7 11 clock setup 9 stop-mode recovery source 10
ps024502-1205preliminary ac characteristics zlr64400 rom mcu product specification 128 table 61.ac characteristics nosymbolparameterv cc t a = 0 o c to +70 o c 8.0 mhz units wdtmr (bits 1:0) min.max. 1t p cinput clock period 1 2.0 ? 3.6121dcns 2t r c,t f cclock input rise and fall times 1 2.0 ? 3.625ns 3t w cinput clock width 1 2.0 ? 3.637ns 4t w t in ltimer input low width 1 2.0100ns 3.670ns 5t w t in htimer input high width 1 2.0 ? 3.63t p c 6t p t in timer input period 1 2.0 ? 3.68t p c 7t r t in ,t f t in timer input rise and fall timers 1 2.0 ? 3.6100ns 8t w ilinterrupt request low time 1,2 2.0 100ns 3.670ns 9t w ihinterrupt request input high time 1,2 2.0 ? 3.65t p c 10t wsm stop-mode recovery width spec 2.0 ? 3.612 3 10 t p c 4 ns 11t ost oscillator start-up time 4 2.0 ? 3.65t p c 12t wdt watch-dog timer delay time 2.0 ? 3.65ms0, 0 2.0 ? 3.610ms0, 1 2.0 ? 3.620ms1, 0 2.0 ? 3.680ms1, 1 13t por power-on reset2.0 ? 3.62.510ms 14f iramp frequency of input signal for ir amplifier 0500khz notes: 1.timing reference uses 0.9 v cc for a logic 1 and 0.1 v cc for a logic 0. 2.interrupt request through port 3 (p33:p31). 3.smr ? bit 5 = 1. 4.smr ? bit 5 = 0.
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 129 packaging figure 41 illustrates the 28-pin ssop (shrink small outline package) for the zlr64400 device. figure 41. 28-pin ssop package diagram ?t?? ? ?? t y ?? ? ?????y? ?? ? ee? ? e?? ??e e? ?e ee? ?ee ? e ? ee?? ?e e? ?e?e ? e ?e ??? e?? ? e? ee eee? ee ee?e e?e? eee e? ee? ee?? ee eee? ee e?e? eee ee? ee eee ee eee eee ee?? e??? eee ee e?? ee e e?e ?e ? ?e e?? ?? ? ? ? y????? ??? ??? ??? y?e???? ? ee y?? ? y ??? ? ? ??? ?? ?? e??? ?? ? ? t ? e ??? ?
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 130 figure 42 illustrates the 28-pin soic (small outline integrated circuit) package for the zlr64400 device. figure 42. 28-pin soic package diagram
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 131 figure 43 illustrates the 28-pin pdip (plastic dual inline package) for the zlr64400 device. figure 43. 28-pin pdip package diagram
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 132 figure 44 illustrates the 20-pin ssop (shrink small outline package) for the zlr64400 device. figure 44. 20-pin ssop package diagram
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 133 figure 45 illustrates the 20-pin soic (small outline integrated circuit) package for the zlr64400 device. figure 45. 20-pin soic package diagram
ps024502-1205preliminary packaging zlr64400 rom mcu product specification 134 figure 46 illustrates the 20-pin pdip (plastic dual inline package) for the zlr64400 device. figure 46. 20-pin pdip package diagram
ps024502-1205preliminary ordering information zlr64400 rom mcu product specification 135 ordering information table 62 provides a product specification index code and a brief description of each part. each of the parts listed in table 62 is shown in a lead-free package. the use of lead-free packaging adheres to a socially responsible environmental standard. see the part number description on page 136 for a description of a part number ? s unique identifying attributes. navigate your browser to zilog ? s website to order the zlp12840 microcontroller. or, contact your local zilog sales office . zilog provides additional assistance on its cus- tomer service page, and is also here to help with technical support issues. for zilog ? s valuable development tools and downloadable software , visit the zilog website . table 62.zlr64400 rom mcu part numbers description psi #descriptionpsi #description zlr64400h2864g28-pin ssop 64k romzlr64400h2832g28-pin ssop 32k rom zlr64400s2864g28-pin soic 64k romzlr64400s2832g28-pin soic 32k rom zlr64400p2864g28-pin pdip 64k romzlr64400p2832g28-pin pdip 32k rom zlr64400h2064g20-pin ssop 64k romZLR64400H2032G20-pin ssop 32k rom zlr64400s2064g20-pin soic 64k romzlr64400s2032g20-pin soic 32k rom zlr64400p2064g20-pin pdip 64k romzlr64400p2032g20-pin pdip 32k rom crimzon ? 128k emulator zlp128ice01zemcrimzon ? in-circuit emulator
ps024502-1205preliminary part number description zlr64400 rom mcu product specification 136 part number description zilog part numbers consist of a number of components, as shown in figure 47 . the example part number zlr64400h2864g is a crimzon ? 64k rom product in a 28-pin ssop package, with 64 kb of rom and built using lead-free solder. figure 47. part number example zlr64400h2864g environmental flow g = lead free memory size 32= 32 kb rom 64 = 64 kb otp number of pins in package 20 = 20 pins 28 = 28 pins package type h = ssop s = soic p = pdip product number: 64400 product line: crimzon ? rom zilog product prefix
ps024502-1205preliminary precharacterization product zlr64400 rom mcu product specification 137 precharacterization product the product represented by this document is newly introduced and zilog has not com- pleted the full characterization of the product. the document states what zilog knows about this product at this time, but additional features or nonconformance with some aspects of the document might be found, either by zilog or its customers in the course of further application and characterization work. in addition, zilog cautions that delivery might be uncertain at times due to start-up yield issues. zilog, inc. 532 race street san jose, ca 95126-3432 telephone: (408) 558-8500 fax: 408 558-8300 www.zilog.com
ps024502-1205preliminary document information zlr64400 rom mcu product specification 138 document information document number description the document control number that appears in the footer on each page of this document contains unique identifying attributes, as indicated in the following example: change log figure 48. document number example revdatepurpose 011105original issue 021205updated input/output port and clock sections ps024502-1205 year published month published revision number unique document number product specification prefix
ps024502-1205preliminary customer feedback form zlr64400 rom mcu product specification 139 customer feedback form the zlr64400 rom mcu product specification if you experience any problems while operating this product, or if you note any inaccuracies while reading this product specification, please copy and complete this form, then mail or fax it to zilog (see return information , below). we also welcome your suggestions! customer information product information return information zilog system test/customer support 532 race street san jose, ca 95126 phone: (408) 558-8500 fax: (408) 558-8536 www.zilog.com problem description or suggestion provide a complete description of the problem or your suggestion. if you are reporting a specific problem, include all steps leading up to the occurrence of the problem. attach additional pages as necessary. _____________________________________________________________________________________________ _____________________________________________________________________________________________ _____________________________________________________________________________________________ _____________________________________________________________________________________________ _____________________________________________________________________________________________ namecountry companyphone addressfax city/state/zipemail serial # or board fab #/rev. # software version document number host computer description/type
zlr64400 rom mcu product specification ps024502-1205preliminary index 140 index numerics 12-bit address map 35 16-bit counter/timer circuits 65 20-pin package pins 5, 6, 7 pdip package 134 soic package 133 ssop package 132 28-pin package pins 8, 9, 10 pdip package 131 soic package 130 ssop package 129 8-bit counter/timer circuits 60 a absolute maximum ratings 123 ac characteristics 127, 128 ac timing 127 active low notation 3 address 12-bit linear 35 notation 111 amplifier, infrared 41 and caution 74 architecture mpu 1 uart 42 asynchronous data 44 b baud rate generator description 49 example 51 interrupt 49 baud rate generator constant register (bcnst) 54 block diagram counter/timer 56 interrupt 83 mcu 4 reset and watch-dog timer 93 uart 43 brown-out, voltage 94 c capacitance 124 caution open-drain output 11 stopping timer 61 timer count 60 timer modes 76 timer registers 66 uart transmit 45 changes, document 138 characteristics ac 127, 128 dc 125 electrical 123 clock 90 internal signals 91 cmos gate, caution 11 comparator inputs 19 outputs 19 condition codes 115 conditions, test 124 connection, power 3 constant memory 28, 29 constant, baud rate 54 counter/timer block diagram 56 capture flowchart 62 input circuit 58 output configuration 18 crystal 90 crystal oscillator pins (xtal1, xtal2) 90, 91
zlr64400 rom mcu product specification ps024502-1205preliminary index 141 d data format, uart 43, 44 data handling, uart 48 dc characteristics 125 demodulation changing mode 76 flowchart 62, 63 timer 61, 66 demodulation mode flowchart 64 device architecture 1 block diagram 4 features 1 part numbers 135 diagram, package 129, 130, 131, 132, 133, 134 divisor, baud rate 54 document changes 138 information 138 number format 138 e electrical characteristics 123 error handling, uart 48 example bcnst register 51 register pointer 33 f fast recovery, stop mode 96 features, device 1 feedback form 139 flags register 114 floating cmos gate, caution 11 flowchart demodulation mode 62, 63, 64 timer transmit 59 uart receive 49 form, feedback 139 format, uart data 43, 44 functional block diagram 4 functions, i/o port pins 11 h h suffix 60 halt mode 95 handshaking, uart 47 i i/o port pin functions 11 infrared learning amplifier 41 input comparator 19 counter/timer 58 timers 57 instruction set summary 116 instruction symbols 113 internal clock 91 interrupt baud rate generator 49 block diagram 83 description 82 mask register 89 priority register 86 request register 85, 87 source 84 stop-mode recovery 96 type 84 uart 47 uart receive 46, 47, 49 uart transmit 45, 47 vector 84 interrupt mask register (imr) 89 interrupt priority register (ipr) 86 interrupt request register (irq) 85, 87 l lde and ldei instructions removed 34 ldx, ldxi instruction addresses 35 leakage, caution 11 learning amplifier, infrared 41 linear address 33
zlr64400 rom mcu product specification ps024502-1205preliminary index 142 load, test 124 low-voltage detection register (lvd) 95 m map program/constant memory 29 register 12-bit 35 register 8-bit 31 register file summary 38 maximum ratings 123 mcu block diagram 4 features 1 part numbers 135 memory address, linear 33 program/constant 28 program/constant map 29 register 12-bit map 35 register file map 31 register file summary 38 modulo-n mode 61, 66 mpu architecture 1 n notation addressing 111 operand 111 o open-drain output caution 11 operand symbols 111 operation, uart 43 or caution 74 ordering information 135 oscillator 90 otp memory 28 output comparator 19 timer/counter 68 timer/counter circuit 69 timer/counter configuration 18 overline, in text 3 overrun, uart 48 p package diagram 129, 130, 131, 132, 133, 134 package information 129 parity, uart data 44 part number format 135, 136 pin description 5 pin function port 0 12 port 2 13 port 3 14 port 3 summary 17 ping-pong mode 67, 68 pins 20-pin package 5, 6, 7 28-pin package 8, 9, 10 polled uart receive 46 polled uart transmit 44 port 0 configuration 13 pin function 12 port 0 mode register (p01m) 21 port 0 register (p0) 22 port 2 configuration 14 pin function 13 port 2 mode register (p2m) 23 port 2 register (p2) 24 port 3 configuration 15 counter/timer output 18 pin function 14 pin function 17 port 3 mode register (p3m) 25 port 3 register (p3) 26 port configuration register (pcon) 20 port pin functions 11 power connection 3 power management 92 power-on reset timer 93
zlr64400 rom mcu product specification ps024502-1205preliminary index 143 precharacterization 137 program memory description 28 map 29 program memory paging register (pmpr) 36 programming summary 111 pull-up, disabled 11 r ratings, maximum 123 register bcnst 54 ctr1 76 ctr3 80 hi16 71 hi8 70 imr 89 ipr 86 irq 85, 87 lo16 71 lo8 70 lvd 95 p0 22 p01m 21 p2 24 p2m 23 p3 26 p3m 25 pcon 20 pmpr 36 rp 36 smr 99 smr1 102 smr2 104 smr3 107 smr4 108 spl 37 uctl 53 urdata 51 user 37 ust 52 utdata 51 wdtmr 109 register file 12-bit address 35 address summary 38 description 29 memory map 31 register pointer detail 32 example 33 register pointer register (rp) 36 register pointer register (rp) 36 reset block diagram 93 delay bypass 96 features 92 por timer 93 status 94 timer terminal count 74 s sclk signal 91 single-pass mode 61, 66 source interrupt 84 stop-mode recovery 97, 98, 101, 103, 106 stack 30 stack pointer register (spl) 37 standard test conditions 124 standby, brown-out 94 status reset 94 uart 52 stop bit, uart 48 stop mode fast recovery 96 stop-mode description 96 recovery events 97, 100, 103, 105 recovery interrupt 96 recovery source 97, 98, 101, 103, 106 recovery status 94 stop-mode recovery register (smr) 99 stop-mode recovery register 1 (smr1) 102 stop-mode recovery register 2 (smr2) 104
zlr64400 rom mcu product specification ps024502-1205preliminary index 144 stop-mode recovery register 3 (smr3) 107 stop-mode recovery register 4 (smr4) 108 suffix, h 60 symbols address 111 instruction 113 operand 111 t t16_out signal modulo-n mode 66 single-pass mode 66 t8_out signal modulo-n mode 61 single-pass mode 61 tclk signal 91 terminal count, reset 74 test conditions 124 test load 124 timer block diagram 56 changing mode 76 description 56 input circuit 57, 58 output circuit 69 output configuration 18 output description 68 reset 93 starting count caution 60 stopping caution 61 t16 demodulation 66 t16 transmit 65 t16_out signal 66 t8 demodulation 61 t8 transmit 58 t8_out signal 61 transmit flowchart 59 transmit versus demodulation mode 76 timer 16 capture high register (hi16) 71 timer 16 capture low register (l016) 71 timer 16 control register (ctr2) 79 timer 16 high hold register (tc16h) 72 timer 16 low hold register (tc16l) 72 timer 8 and timer 16 common functions register (ctr1) 76 timer 8 capture high register (hi8) 70 timer 8 capture low register (l08) 70 timer 8 control register (ctr0) 74 timer 8 high hold register (tc8h) 73 timer 8 low hold register (tc8l) 73 timer 8/timer 16 control register (ctr3) 80 timing, ac 127 transmit caution, uart 45 transmit mode caution 76 flowchart 59 timer 58, 65 u uart architecture 42 baud rate generator 49 block diagram 43 data and error handling 48 data format 43, 44 description 42 interrupts 47 operation 43 overrun error 48 polled receive 46 polled transmit 44 receive interrupt 46, 47, 49 stop bit 48 transmit caution 45 transmit interrupt 45, 47 uart control register (uctl) 53 uart receive/transmit data register (urda- ta/utdata) 51 uart status register (ust) 52 user data register (user) 37 v vector, interrupt 84 voltage brown-out 94
zlr64400 rom mcu product specification ps024502-1205preliminary index 145 detection 94 detection register 95 w watch-dog timer description 109 diagram 93 watch-dog timer mode register (wdtmr) 109 x xtal1 pin 90 xtal2 pin 91 z zlr64400 mcu block diagram 4 features 1 part numbers 135


▲Up To Search▲   

 
Price & Availability of ZLR64400H2032G

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X